无法在IE中打开xls文件

Vol*_*lyy 8 https jsf internet-explorer internet-explorer-8

我们有JSF Web应用程序,它生成XLS文件并为用户提供指向该文件的链接.
如果通过HTTP访问此文件,一切正常.
但IE(8)无法通过HTTPS打开/保存此xls文件.
有以下错误消息:

Internet Explorer cannot download ...466088C5C313F92808BDB0AFF3447 from testhost.

Internet Explorer was not able to open this Internet site.  The requested site is either unavailable or cannot be found.  Please try again later.
Run Code Online (Sandbox Code Playgroud)

我可以在Firefox和Chrome中通过HTTPS打开同一个文档.
IE可能有什么问题?

头:

HTTP/1.1 200 OK
Date: Fri, 18 Jun 2010 14:45:42 GMT
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
X-UA-Compatible: IE=EmulateIE7
Last-Modified: Fri, 18 Jun 2010 14:45:11 GMT
Cache-control: max-age=0, no-store, no-cache
Pragma: no-cache
Expires: 0
Content-Type: application/vnd.ms-excel
Content-Length: 6656
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Run Code Online (Sandbox Code Playgroud)

hou*_*oft 12

根据http://support.microsoft.com/kb/316431,您应该删除您使用的任何HTTP标头:

Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate
Run Code Online (Sandbox Code Playgroud)

  • @Vladimir Bezugliy:删除那些. (2认同)

Mar*_*ker 6

最可能的原因是http响应头,我们必须专门为ssl下的xls文件配置

Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Fri, 18 Jun 2010 16:22:07 GMT
Cache-Control: cache, must-revalidate
Pragma: public
Run Code Online (Sandbox Code Playgroud)

用于缓存控制和

Content-Type: application/vnd.ms-excel
Content-Disposition: attachment; filename="ExcelDownload.xls"
Content-Transfer-Encoding: binary
Content-Length: <fileSize>
Run Code Online (Sandbox Code Playgroud)

对于内容

关键条目是Pragma:public