Written by me@grafxflow
27 Mar, 2011
0
3,797
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 );
to
header("Content-Disposition: attachment; filename="" . $file . """);
Enjoy the problem is solved!
12 Jan, 2010
09 Aug, 2015
I am a Full-stack Developer who also started delving into the world of UX/UI Design a few years back. I blog and tweet to hopefully share a little bit of knowledge that can help others around the web. Thanks for stopping by!
Follow11 Jul, 2023
21 Jun, 2023
Views: 166,601
Views: 40,471
Views: 37,239
Views: 33,743