【发布时间】:2010-09-17 19:09:42
【问题描述】:
我正在使用 PHP 从数据库查询中创建 CSV 文件。
我运行查询,设置标题,并在 Firefox 中加载页面,文件提示下载并在 excel 中打开,就像它应该做的那样。
当我在 IE 中尝试时,我收到一条错误消息:Internet Explorer cannot download ReportPrint.php from www.website.com.
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
不知道可以做些什么来解决这个问题。
header('Content-Description: File Transfer');
header("Content-Type: application/csv") ;
header("Content-Disposition: attachment; filename=Report.csv");
header("Pragma: no-cache");
header("Expires: 0");
echo "record1,record2,record3\n";
【问题讨论】:
-
旁注:
Expires标头需要 date
标签: php http-headers