0

尝试下载文件时,在 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));

请帮忙

4

0 回答 0