tips & tricks


Calendario
luglio 2024
lmmgvsd
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

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: 13.892
  • Views Posts: 56.626
  • 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