Download Server Excel File

1

To download an excel file, This is my code but just send me an alert with an "OK", use a generic Handler.

public void ProcessRequest(HttpContext context)
    {
        System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
        response.Clear();
        response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
        response.AddHeader("Content-Disposition","attachment; filename=Reporte de Extensiones.xlsx");
        response.TransmitFile(context.Server.MapPath("/Files/Reporte de Extensiones.xlsx"));
        response.End();
    }
    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
    
asked by Ivan Palomares 07.07.2017 в 17:22
source

0 answers