tips & tricks


Calendario
dicembre 2024
lmmgvsd
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

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: 15.071
  • Views Posts: 58.257
  • Views Gallerie: 2.837
  • n° Posts: 117
  • n° Commenti: 1
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003