Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open xls file in IE

We have JSF web application that generates XLS file and gives user link to thes file.
All works fine if access this file via HTTP.
But IE(8) cannot open/save this xls file via HTTPS.
There is following error message:

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.

I can open the same document via HTTPS in Firefox and in Chrome.
What can be the problem with IE?

Headers:

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
like image 289
Volodymyr Bezuglyy Avatar asked Jun 18 '10 15:06

Volodymyr Bezuglyy


2 Answers

According to http://support.microsoft.com/kb/316431 , you should remove any of these HTTP headers you use:

Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate
like image 177
houbysoft Avatar answered Sep 21 '22 15:09

houbysoft


Most likely cause is the http response headers, which we had to configure specifically for xls files under ssl

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

for the cache control and

Content-Type: application/vnd.ms-excel
Content-Disposition: attachment; filename="ExcelDownload.xls"
Content-Transfer-Encoding: binary
Content-Length: <fileSize>

for the content

The key entry is Pragma: public

like image 43
Mark Baker Avatar answered Sep 19 '22 15:09

Mark Baker