nel*_*ong 8 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'");
Run Code Online (Sandbox Code Playgroud)
并且连接被Fiddler捕获.
当我尝试在IE8(而不是SSL)中下载带有上述标题的文件时,消息框:
"Internet Explorer无法打开此Internet站点.请求的站点不可用或无法找到." 弹出并下载停止.
我在网上搜索并尝试了很多解决方案,但似乎没有一个可行.这个问题还有其他解决办法吗?
PS:我试过:删除标题中的响应标题/重置contentType /将网站添加到受信任的站点/设置"不将加密的页面保存到磁盘"为true.
谢谢.
除了Le-roy的回答:
我设置
Cache-Control: private, max-age=1
Run Code Online (Sandbox Code Playgroud)
这解决了我的问题.
从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
Run Code Online (Sandbox Code Playgroud)
IE下载将失败.
当标头中设置 no-cache 时,IE 从 HTTPS 下载文件时会出现问题。请尝试此页面http://blogs.msdn.com/b/ieinternals/archive/2009/10/02/internet-explorer-cannot-download-over-https-when-no-cache.aspx了解更多信息。
| 归档时间: |
|
| 查看次数: |
18290 次 |
| 最近记录: |