tips & tricks


Calendario
febbraio 2023
lmmgvsd
303112345
6789101112
13141516171819
20212223242526
272812345
6789101112

Download file from Aspx page

   Download file from Aspx page


    protected void Download(byte[] zipBytes)
    {
        System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
        string fileName = "tracciati.zip";
        response.ContentType = "binary/octet-stream";
        response.AddHeader("Content-Type", "binary/octet-stream");
        response.AddHeader("Content-Disposition", "attachment;filename=" + fileName + "; size=" + zipBytes.Length);
        response.Flush();
        response.BinaryWrite(zipBytes);
        response.Flush();
        response.End();
    }
Categoria: ASP.NET
martedì, 02 gen 2018 Ore. 12.46
Archivio Posts
Anno 2020

Anno 2018

Anno 2015

Anno 2013

Anno 2011

Anno 2010

Anno 2009

Anno 2008
Statistiche
  • Views Home Page: 11.245
  • Views Posts: 55.109
  • Views Gallerie: 2.837
  • n° Posts: 120
  • n° Commenti: 1
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003