Failed - network error when downloading excel file made by EPPlus.dll

前端 未结 5 2447

I try to download an excel file made by EPPlus.dll from an asp.net c# web form application. but i get Failed - network error. It should be noted that mentioned erro

5条回答
  •  滥情空心
    2021-02-20 00:07

    I had the same problem and I solved with the code below, note the quotes in filename=\"Name.xlsx\":

    Response.Buffer = true;
    Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
    Response.AppendHeader("content-disposition", "attachment; filename=\"Name.xlsx\"");
    //Writeout the Content  
    Response.BinaryWrite(bytes);
    

提交回复
热议问题