W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2010

FormData questions

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 12 Feb 2010 17:32:18 -0800
Message-ID: <63df84f1002121732h60eb339ehde85dd043437dc5c@mail.gmail.com>
To: Webapps WG <public-webapps@w3.org>
Hi WebApps fans!

Working on implementing FormData and ran into a couple of questions.

First of all, I assume that it is intended that a FromData object can
be submitted several times. I.e. that the following code is ok:

fd = new FormData;
fd.append("name1", "foo");
xhr1 = new XMLHttpRequest;
fd.append("name2", "bar");
xhr2 = new XMLHttpRequest;

where the first XHR will send 1 name/value pair, and the second XHR
will send 2. I do think this should be allowed, but I wanted to make
sure others agreed.

Second, what encoding should be used when submitting a FromData
object? A few options are:
* Always use UTF-8
* Allow a mimetype to be set on the FormData object, using a property
or constructor argument
* Use the charset mime parameter specified on the content-type header
set using xhr.setRequestHeader

I think the last one would be a pain for authors and for implementors.

Lastly, there is a bug in the spec where it says that the mimetype
should be "multipart/form-data". It needs to be "multipart/form-data;
boundary=" plus the boundary used while encoding. This also brings up
the question what to do if a Content-Type header has already been set.
Should a boundary mime parameter be added, or is the server side
simply out of luck and won't get to know what the boundary is?

/ Jonas
Received on Saturday, 13 February 2010 01:33:11 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:22 UTC