Firefox issue with spaces in excel download file name
Recently I was working on an php class to save down an excel file from a database. And the client got back to me saying the filename was the wrong format and had no extension. So I asked them to send me the file.
And it turned out there is an issue with the Firefox browser not allowing spaces in download file names when using the php header. So 'Example download file.xls' became 'Example'. This happened with all files even Acrobat pdfs.
I did some research and found a way of making it work. Which meant changing the following
header("Content-Disposition: attachment; filename=" . $file );
header("Content-Disposition: attachment; filename="" . $file . """);
Enjoy the problem is solved!
Visitors also viewed these posts