我正在Ionic.Zip.dll
像这样(ASP.NET,C#)创建一个 zip:
zip.AddEntry("Document.jpeg", File.ReadAllBytes("Path");
我想像这样下载它:
Response.Clear();
Response.BufferOutput = false;
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "filename=SuppliersDocuments.zip";
zip.Save(Response.OutputStream);
Response.Close();
我通过 Firefox 和 Chrome 在 localhost 中测试了这段代码,它工作正常。但是当我在主机中测试这段代码时,我得到了这个错误:
失败 - 网络错误
我的代码错了吗?