IE8 :Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found

谁都会走 提交于 2020-01-02 02:31:18

问题


This should be a old problem about IE8 download problem. I used PHP to set the response header like:

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'");

and the Connection is close capture by Fiddler.

When I try to download the file with above header in IE8 (not in SSL), the message box :

"Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found." pop up and download is stopped.

I searched on net and try lots of solutions but seems none of them works. Would there be any other solution for this problem?

PS: I have tried: Delete response header/reset contentType in header/ Add the site into trusted site/ set "Do not save encrypted pages to disk" as true.

Thanks.


回答1:


In addition to Le-roy's answer:

I set

Cache-Control: private, max-age=1

and that fixed the issue for me.

From Le-roy's link, if any of these are set:

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

IE download will fail.




回答2:


IE has problems with downloading files from HTTPS when no-cache is set in the header. Try this page http://blogs.msdn.com/b/ieinternals/archive/2009/10/02/internet-explorer-cannot-download-over-https-when-no-cache.aspx for more info.



来源:https://stackoverflow.com/questions/16028422/ie8-internet-explorer-was-not-able-to-open-this-internet-site-the-requested-si

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!