我失去了这一个.我已经看完了,似乎有很多的解决方案,但他们不为我工作.我有一个CGI ::应用程序应用程序生成一个MS Excel电子表格与Spreadsheet :: WriteExcel.这可以在一段时间内运行正常,直到几周前我们的实时服务器出现硬件故障.我们使用中断作为借口升级到
Windows Server 2008(从2003年)和Apache 2.2.17(从2.2.11).现在,在尝试下载电子表格时,我收到客户收到的错误消息(但是太频繁地忽略了):
Internet Explorer cannot download [url] from [site].
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
我在XP,Vista和7上尝试过IE 7-8,并且无法在本地重现此错误.有问题的用户每次都有它,而不是随机.所有投诉来自IE用户,主要是IE8.
在阅读有关错误消息的几个帖子后,我添加了-expires标题无效. (没有办法直接测试,我不得不实施一个修复,等待一天左右,看看是否有人停止抱怨.
- sub export_spreadsheet {
- my $self = shift;
- binmode STDOUT;
- my $str;
- open my $fh,'>',\$str;
- my $workbook = Spreadsheet::WriteExcel->new($fh);
- # words words words
- $workbook->close;
- close $fh;
- $self->header_add(-type => 'application/vnd.ms-excel',-expires => '+1d',-attachment => 'export.xls');
- return $str;
- }
请求的标题看起来正常.这些在我的本地机器上收集,记住你.
- HTTP/1.1 200 OK
- Date: Tue,31 May 2011 22:23:17 GMT
- Server: Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o mod_perl/2.0.4-dev Perl/v5.10.1
- Expires: Wed,01 Jun 2011 22:23:18 GMT
- Content-Disposition: attachment; filename="export.xls"
- Vary: Accept-Encoding
- Keep-Alive: timeout=5,max=100
- Content-Type: application/vnd.ms-excel
- Content-Length: 18944
- Accept-Ranges: none
- Proxy-Connection: Keep-Alive
我们向客户(无法或不愿意切换到备用浏览器)的现有解决方法是通过键入https本身来切换到SSL. SSL下载对于已经尝试过并得到我们的人来说是正常的.猜测:它可能是一个下游代理搞乱我们的头?这可能是为什么它在SSL和普通HTTP中的错误工作? (在这种情况下,服务器升级将是一个不幸的巧合.)