tips & tricks


Calendario
settembre 2023
lmmgvsd
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

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.786
  • Views Posts: 56.334
  • 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