这应该是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'");
并且 Connection 被 Fiddler 近距离捕获。
当我尝试在 IE8(不是 SSL)中下载具有上述标头的文件时,消息框:
“Internet Explorer 无法打开此 Internet 站点。请求的站点不可用或找不到。”弹出并停止下载。
我在网上搜索并尝试了很多解决方案,但似乎没有一个有效。对于这个问题还有其他解决方案吗?
PS:我尝试过:删除响应标头/设置内容键入标头/将站点添加到受信任站点/将“不将加密页面保存到磁盘”设置为true。
Thanks.
除了勒罗伊的回答之外:
I set
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下载会失败。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)