`
屾顶洞人
  • 浏览: 17666 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

HTTPS下载出现“Internet Explorer Cannot Download”的问题

 
阅读更多

记一下,怕忘了。

【问题描述】

本来就是一段PHP控制下载文件的问题。但是在某些操作系统和ie6下面,总是出弹出

“internet explorer cannot download”

【分析与解决】

之前改header改好过一次,但是这次怎么折腾这些报头,ie都不弹出那个[open/save]的对话框了。最后终于找到了问题的根源:

http://support.microsoft.com/kb/812935

"Internet Explorer Cannot Download" Error Message When You Use an HTTPS URL to Open an Office Document or PDF File

在微软的kb文档里面,描述了导致这个问题的原因和解决方法:

To work around this problem, make sure that Do Not Save Encrypted Files check box is not checked and that the server does not send the "Cache-Control: No Store" or the "Cache-Control: No Cache" header.

You may also be able to work around this problem by using an HREF to load the document.

Note This method does not work if the server uses the "Cache-Control: No Cache" header.

对于用户来说:

需要在ie选项->高级中去掉“Do not save encrypted pages to disk”前面的勾。如下图

ie高级选项

对于服务器端:

1、不要发送Cache-Control: No Store 或者 Cache-Control: No Cache的header头

2、换用<a href="..."></a>这种标签来下载office或者pdf文档。(我之前是控制某个frame.src来下载文档的。)

【附件】

附上php的下载文件时的header部分代码。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics