WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
UNCONFIRMED
63388
Using FormData to upload a DataTransferItem generated random filename
https://bugs.webkit.org/show_bug.cgi?id=63388
Summary
Using FormData to upload a DataTransferItem generated random filename
Alfonso Martínez de Lizarrondo
Reported
2011-06-25 13:24:05 PDT
With
https://bugs.webkit.org/show_bug.cgi?id=58106
it's possible to get access to a pasted image in the paste event and as explained here
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-March/030881.html
it's a Blob Then that Blob can be send to the server with FormData: var formdata = new FormData(); formdata.append("upload", file); xhr.send(formdata); But that will set only the name of the form element ("upload") that can be used at the server to read the file. The filename itself will be a random string like Blob8edfed3b35de4b39a42a69f96081e5d1 that doesn't include even the '.png' extension So if the server is performing some basic filtering according to the uploaded filenames, that file will be rejected. If the server doesn't add itself the '.png' extension, then it might not be sent back when the client request it (due to a security policy to not send unknown file types) Possible solutions: Generate a more useful automatic filename allow to specify a filename in the formdata.append, or the blob allow to get the whole blob as a string and then perform a sendAsBinary like Firefox where we can build the exact form specifying everything
Attachments
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug