【发布时间】:2012-06-02 16:01:03
【问题描述】:
我一直在使用 PHP 脚本将数据从我的数据库 (mysql) 导出到 XLS 文件。
虽然文件导出过程在 Firefox 和 IE 上运行良好。
我在尝试使用 Google Chrome 导出时遇到错误。
谷歌浏览器错误是
Duplicate headers received from server
The response from the server contained duplicate headers. This problem is generally the result of a misconfigured website or proxy. Only the website or proxy administrator can fix this issue.
Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION): Multiple distinct Content-Disposition headers received. This is disallowed to protect against HTTP response splitting attacks.
我需要一些帮助。
谢谢
【问题讨论】:
-
HTTP 响应标头有问题。使用 Fiddler 捕获 HTTP 标头并在此处发布。
-
发生在我身上。通过从文件名中删除逗号来修复它
-
另一个答案将
header("Content-Disposition: attachment; filename={$file}");更改为header("Content-Disposition: attachment; filename=\"{$file}\""); -
在我的情况下,这样做会导致此处描述的错误:stackoverflow.com/questions/6530569/…
标签: php google-chrome