I am creating a zip by Ionic.Zip.dll
like this (ASP.NET,C#):
zip.AddEntry("Document.jpeg", File.ReadAllBytes("Path");
I want to download it like this:
Response.Clear();
Response.BufferOutput = false;
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "filename=SuppliersDocuments.zip";
zip.Save(Response.OutputStream);
Response.Close();
I tested this code in localhost by Firefox and Chrome and it worked properly. But when I test this code in host, I get this error:
Failed - network error
Is my code is wrong?
I ran into a similar issue with relaying an SSRS report. Taking @Arvin's suggestion, I did the following:
The fix was adding the Content-Length header and setting it to the size of the byte array from reporting services.