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部分代码。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值