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

前端 未结 5 2442

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-19 23:55

    I had the same problem when I was using Response.Clear() and Response.Close() and had to avoid them to look my code as below which is working.

    Response.Buffer = true;
    Response.ContentType = mimeType;
    Response.AddHeader("Content-Disposition", "attachment; filename=" + nameOfFile);
    Response.BinaryWrite(bytes);
    Response.End();
    

提交回复
热议问题