[Webkit-unassigned] [Bug 26979] New: Sending a file with XmlHttpRequest.send() doesn't include boundary separators
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Jul 5 08:37:37 PDT 2009
https://bugs.webkit.org/show_bug.cgi?id=26979
Summary: Sending a file with XmlHttpRequest.send() doesn't
include boundary separators
Product: WebKit
Version: 528+ (Nightly build)
Platform: PC
OS/Version: Windows XP
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: HTML DOM
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: amla70 at gmail.com
Webkit does allow to send a file from an <input type="file"> with
XmlHttpRequest.send, but when it does so, the contents of the body sent to the
server are just the contents of the file, without the form boundaries like any
other form does.
In Firefox it's possible to call file.getAsBinary() to get the contents as a
string and manually construct the full form data and then send it with
XmlHttpRequest.sendAsBinary
The current behavior means that special coding is required at the server end to
accept this special uploads, it's not possible to change only the client side
to get an ajax upload as it's possible with the Firefox system.
This problem might need to be fixed before multiple files upload
(https://bugs.webkit.org/show_bug.cgi?id=25923) is possible, or all the files
would be sent one after another.
Ideally, when sending a file, the
Content-Type: multipart/form-data; boundary=--42147134553451418--
header should be added, and in the body the boundary should be created also,
that would make it very easy to use. The missing part is the field name...
--42147134553451418--
Content-Disposition: form-data; name="NewFile"; filename="myPic.jpg"
Content-Type: application/octet-stream
But the important part is to have some method to properly send the file as a
normal form would do, without any change to the server code to parse "raw"
data. (it does lack even the file name!)
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list