I have inherited an old application that stores a zip file in a database and needs to retrieve this file. In Firefox is works fine, I can open the zip and each file inside it is fine. When I run it in IE7 I get the following error.
Internet Explorer cannot download ProductContentFormImage.aspx from localhost.
Internet Explorer was not able to open this Internet site. 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();