New issue
Advanced search Search tips
Starred by 2 users
Status: Fixed
Owner: ----
Closed: Mar 2013
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment
FormData.append(_, File, filename) uses the File name instead of the 3rd argument's value
Project Member Reported by cos...@gmail.com, Dec 10 2012 Back to list
Chrome Version       : 25.0.1349.2 (Official Build 171264) dev
URLs (if applicable) : http://jsbin.com/irefov/1/edit
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
Safari 5:
  Firefox 4.x: FAIL (assuming you mean Firefox 17.x)
       IE 7/8/9: FAIL (FormData not implemented)

What steps will reproduce the problem?
1. Load the following JSbin -- http://jsbin.com/irefov/1/edit
2. Open the Developer Tools.
3. Click the 'Choose file' button in the <input type="file">, select a (preferably small text) file.
4. Click the XHR to zn-testbed.herokuapp.com' in the Network pane. Click the 'Request' tab, and look at the 'Request payload'
5. Look at the name after "filename=" in the form data.

What is the expected result?
The file name should be "file.name.from.js", as supplied in JavaScript.

What happens instead?
The file name is the name of the file selected in the <input type="file"> UI.


Please provide any additional information below. Attach a screenshot if
possible.

Step 6 in the FormData.append algorithm in the spec says that the 3rd argument should be used as the file name, when given.
http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-formdata-append

If it help with the development process, I can provide a test case that uses window.webkitRequestFileSystem to produce a File, so no user interaction is require.
 
Labels: -Area-Undefined Area-WebKit WebKit-Forms OS-All WebKit-Storage-FileSystem
Labels: Mstone-23
Status: Untriaged
Hello,

Able to reproduce the issue.
This issue is present from M19 builds.

Thanks.
Comment 3 by mayhem...@gmail.com, Feb 26 2013
Still happens, it works fine if you send a blob though.
Comment 4 by cos...@gmail.com, Mar 2 2013
I have submitted a patch to WebKit that fixes this bug. I would appreciate any help you can spare in getting it landed.
https://bugs.webkit.org/show_bug.cgi?id=111255
Comment 5 by cos...@gmail.com, Mar 5 2013
A patch for fixing this bug has landed into WebKit, so this bug can be closed.
http://trac.webkit.org/changeset/144677

Comment 6 by tkent@chromium.org, Mar 5 2013
Labels: -Mstone-23 Mstone-27 WebKit-ID-111255
Status: Fixed
Thank you for the fix!

Project Member Comment 7 by bugdroid1@chromium.org, Mar 10 2013
Labels: -Area-WebKit -WebKit-Forms -WebKit-Storage-FileSystem -Mstone-27 Cr-Content Cr-Content-Forms Cr-Content-Storage-FileSystem M-27
Project Member Comment 8 by bugdroid1@chromium.org, Apr 5 2013
Labels: -Cr-Content Cr-Blink
Project Member Comment 9 by bugdroid1@chromium.org, Apr 6 2013
Labels: -Cr-Content-Forms Cr-Blink-Forms
Project Member Comment 10 by bugdroid1@chromium.org, Apr 6 2013
Labels: Cr-Blink-Storage
Project Member Comment 11 by bugdroid1@chromium.org, Apr 6 2013
Labels: -Cr-Content-Storage-FileSystem Cr-Blink-Storage-FileSystem
Sign in to add a comment