When downloading a file with spaces in the filename, v36.0.3 fails to download properly
When I try to download the following file with the link:
Other browsers are fine, but Firefox doesn't handle the spaces properly and the download fails.
Modified
All Replies (4)
In order to post the link you want us to click, could you enclose it in [square brackets]?
For those generating the filename portion of the header, it would be best to replace the spaces with %20 (URI encoding for space).
Here is the link that does not work because Firefox handles spaces differently than Chrome or even IE ...
This is the link to where other people have been dealing with this issue.
https://www.google.com/webhp?sourceid=chrome-instant&ion=1&...
One of the guys I know couldn't reproduce the issue with Firefox, then he upgraded to the latest version and could reproduce the issue, so it seems like in a recent Firefox release, this issue has re-occurred.
Unless this is resolved, our only course of action will be to recommend Chrome to our customers.
Modified
That file isn't coming thru as a PDF file.
As already mentioned, get rid of the spaces in the file name. Plus, the server might need to be tweaked to send a proper header for pdf files so that Firefox "knows" they are PDF files and not an "ocetet-stream" of data. Unlike some other browsers, Firefox is a bit more strict about web security when downloading files; it doesn't "guess" the type of file based solely upon the file suffix, it wants the sending server to identify the file type per being sent via the header per established W3C standards.
I feel it's something of a cop-out to say to your users that you won't make your site work with their preferred browser. Unless it's IE6, I agree with that.
The problem of spaces in file names is actually not a new issue. The article about this on Mozillazine was last updated in 2007: http://kb.mozillazine.org/Filenames_with_spaces_are_truncated_upon_download
If it's a PHP site, two possible workarounds are:
- header("Content-Disposition: attachment; filename=" . str_replace(" ", "_", $strfilename));
- header("Content-Disposition: attachment; filename=" . urlencode($strfilename));
For file: http://jeffersonscher.com/res/PHP urlencode - Manual.pdf