IE8 :Internet Explorer was not able to open this I

2019-04-24 09:03发布

问题:

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.