我已经继承了一个旧的应用程序,它将压缩文件存储在数据库中,并且需要检索该文件。在Firefox中工作正常,我可以打开zip文件,里面的每个文件都很好。当我在IE7中运行它时,出现以下错误。写出一个压缩文件在IE7中不起作用
Internet Explorer无法从localhost下载ProductContentFormImage.aspx。
Internet Explorer无法打开此Internet站点。请求的网站不可用或无法找到。请稍后再试。
我使用下面的代码。
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();