IE8:Internet Explorer无法打开此Internet站点。请求的网站不可用或无法找到

时间:2013-04-16 03:46:16

标签: internet-explorer-8

这应该是关于IE8下载问题的老问题。我使用PHP来设置响应头像:

header("Pragma: public");
header("Expires: 0"); 
header("Content-type: application/octet-stream");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Length: ".strlen($content));
header("Content-Disposition: attachment; filename='$filename'");

并且连接被Fiddler捕获。

当我尝试在IE8(而不是SSL)中下载带有上述标题的文件时,消息框:

“Internet Explorer无法打开此Internet站点。请求的站点不可用或无法找到。”弹出并下载停止。

我在网上搜索并尝试了很多解决方案,但似乎没有一个可行。这个问题还有其他解决办法吗?

PS:我试过:删除标题中的响应标题/重置contentType /将网站添加到受信任的站点/设置“不将加密的页面保存到磁盘”为真。

感谢。

2 个答案:

答案 0 :(得分:5)

除了Le-roy的回答:

我设置

Cache-Control: private, max-age=1

这为我解决了这个问题。

从Le-roy的链接中,如果设置了以下任何一个:

Cache-Control header with the tokens no-cache, no-store
Vary header that specifies almost anything 
Pragma header that specifies exactly no-cache

IE下载将失败。

答案 1 :(得分:4)

IE在标头中设置no-cache时从HTTPS下载文件时出现问题。试试这个页面http://blogs.msdn.com/b/ieinternals/archive/2009/10/02/internet-explorer-cannot-download-over-https-when-no-cache.aspx了解更多信息。