Google Chrome errors while exporting XLS file using PHP

后端 未结 4 1849
后悔当初
后悔当初 2021-01-05 10:29

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

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

I am g

4条回答
  •  自闭症患者
    2021-01-05 11:15

    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:

    Incorrect

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

    Correct

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

    The correction being adding a space between attachment; and filename

    Hope this helps.

提交回复
热议问题