使用PHP导出XLS文件时出现Google Chrome错误 [英] Google Chrome errors while exporting XLS file using PHP

查看:126
本文介绍了使用PHP导出XLS文件时出现Google Chrome错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用PHP脚本将数据从数据库(mysql)导出到XLS文件.

I've been using a PHP script to export data from my database (mysql) to a XLS file.

尽管文件导出过程在Firefox和IE上运行正常.

While the file export process is working fine on Firefox and IE.

尝试使用Google Chrome导出时出现错误.

I am getting errors when trying to export using Google Chrome.

Google Chrome错误是

The Google Chrome error is

    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.

在这方面我需要一些帮助.

I need some assistance on this.

谢谢

推荐答案

我在PHP导出代码的标头部分中发现了我的问题.错误和正确的行如下:

I've found out what my problem was in the header section of the PHP export code. The incorrect and correct lines are as follows:

不正确

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

正确

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

更正是在附件; 文件名

希望这会有所帮助.

这篇关于使用PHP导出XLS文件时出现Google Chrome错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆