使用PHP导出XLS文件时出现Google Chrome错误

我一直在使用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.

我需要一些帮助.

谢谢

解决方法:

我已经在PHP导出代码标题部分找到了我的问题.错误和正确的行如下:

不正确

header("Content-disposition: attachment;filename=\"".$this->filename."\"");

正确

header("Content-disposition: attachment; filename=\"".$this->filename."\"");

修正是在附件之间增加一个空格;和文件

希望这可以帮助.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...