Open
Bug 1148264
Opened 9 years ago
Updated 2 years ago
Firefox does not add a file extension to the download property of an a frame when it should
Categories
(Firefox :: File Handling, defect)
Tracking
()
UNCONFIRMED
People
(Reporter: anthony, Unassigned)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0) Gecko/20100101 Firefox/36.0 Build ID: 20150320202338 Steps to reproduce: Create a <a> frame and set the download parameter to something without an extension. Example: <a href="http://i.imgur.com/cEaV1kw.jpg" download="goodgame"> Actual results: The file is saved without the extension. In the previously mentioned example, the file is downloaded as "goodgame" Expected results: According to WC3, it should have read the MIME type and properly set the download's extension. http://www.w3.org/TR/html5/links.html#downloading-resources In the example, the file should have been downloaded as "goodgame.jpg" or "goodgame.jpeg"
Reporter | ||
Updated•9 years ago
|
Severity: normal → minor
Comment 1•9 years ago
|
||
You're presumably talking about step 19 of the algorithm, right? Did you get a prompt asking what to call the file? Because see step 17 of that algorithm.
Flags: needinfo?(anthony)
Comment 2•9 years ago
|
||
In any case, the DOM code is in fact passing the correct extension (.jpg in this case) to the UI code. See the aSuggestedFileExtension argument to promptForSaveToFileAsync. What the UI then decides to do with it ... depends (e.g. I'm pretty sure on Windows it in fact appends it to things in various cases, via the Windows filepicker).
Component: DOM: Core & HTML → File Handling
Product: Core → Firefox
Reporter | ||
Comment 3•9 years ago
|
||
I do not get a prompt asking what to name the file. Instead, I get a prompt like this: http://i.imgur.com/xztQOyk.png
Flags: needinfo?(anthony)
Reporter | ||
Comment 4•9 years ago
|
||
The file prompt given, which does not allow the user to change the file name.
Comment 5•9 years ago
|
||
Right, but after you pick the "Save" option, there is no filepicker prompting you where to save the file and what to call it? There is for me, with this testcase: data:text/html,<a href="data:image/jpeg,something" download="name">Click me</a> but it's possible I have some non-default setting causing that...
Reporter | ||
Comment 6•9 years ago
|
||
No, there is not. It saves directly to "~/Downloads"
Reporter | ||
Comment 7•9 years ago
|
||
(More specifically, to "~/Downloads/goodgame", continuing the example case)
Comment 8•9 years ago
|
||
I've included an HTML file that causes the issue on both my computer (OS X) as well as Anthony's, you'll need the image that goes with it in the same directory for this to work properly.
Comment 9•9 years ago
|
||
Image file for use with index.html attached previously
Comment 10•9 years ago
|
||
OK. Definitely sounds like a front-end bug, then. If they're going to skip the prompt, they should be sanitizing the name as needed; all the relevant information is there.
Updated•2 years ago
|
Severity: minor → S4
You need to log in
before you can comment on or make changes to this bug.
Description
•