I inherited an old application that stores a zip file in a database and needs to extract this file. It works fine in Firefox, I can open zip, and every file inside it is fine. When I run it in IE7, I get the following error.
Internet Explorer cannot load ProductContentFormImage.aspx from localhost.
Internet Explorer was unable to open this website. The requested site is either unavailable or cannot be found. Please try again later.
I am using the code below.
byte[] content = (byte[])Session["contentBinary"];
Response.ClearContent();
Response.ClearHeaders();
Response.Clear();
Response.Buffer = true;
Response.Expires = 0;
Response.ContentType = "application/zip";
Response.AddHeader("Content-Length", content.Length.ToString());
Response.AddHeader("Content-Disposition", "attachment; filename=content.zip");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.BinaryWrite(content);
Response.End();
source
share