IE中的“无法下载文件”。 PHP标头

时间:2013-07-24 14:29:13

标签: php internet-explorer header

尝试下载文件时,chrome / firefox上的一切正常。但是,如果在IE10中并尝试下载该文件,则会在IE上显示以下错误消息:

test.xlsx couldn't be downloaded

如果我点击重试,则会成功下载。所以我不知道最近发生了什么。不知道我的代码问题或IE浏览器是否存在该问题。

以下是用户尝试下载文件时发送的标题:

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $doc_title.'"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));

请帮助

0 个答案:

没有答案