W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2010

Re: FormData and BlobBuilder - duplication of functionality?

From: Michael Nordman <michaeln@google.com>
Date: Tue, 13 Apr 2010 19:35:23 -0700
Message-ID: <p2gfa2eab051004131935u1ff9c929j5407a53e587790c5@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Dmitry Titov <dimich@google.com>, Web Applications Working Group WG <public-webapps@w3.org>
Good question. Let me ask you one. What value should you use for the
content-type header? That value needs to contain the boundary string. You
need to know that to xhr.send the data in a way that looks like a form
submission. Just sending the blob will be "off by one" and the server side
won't understand it.

Another way to deal with that would be to expose a FormData.boundary
attribute. In my made up use case, callers would have to store the boundary
out of band from the blob, and use it to make a properly formed content-type
header value when xhr.send'ing the blob.

Another reason isn't so much a "need"... but to make the programming
interface symmetrical and hopefully easier to understand and use.


On Tue, Apr 13, 2010 at 6:03 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Tue, Apr 13, 2010 at 5:53 PM, Michael Nordman <michaeln@google.com>
> wrote:
> >
> >
> > On Tue, Apr 13, 2010 at 5:39 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> >>
> >> On Tue, Apr 13, 2010 at 5:34 PM, Michael Nordman <michaeln@google.com>
> >> wrote:
> >> > Hmmm... maybe FormData could have a toBlob() method, and an inverse
> >> > means of
> >> > initializing a FormData object with a properly encoded Blob.
> >>
> >> What's the use case? ;)
> >
> > Persisting FormData and reconstituting it at a later time. For example
> when
> > offline then back online.
>
> Why would you need to recode into a FormData object though? You can
> submit a Blob using XHR the same way you can submit a FormData.


> / Jonas
>
Received on Wednesday, 14 April 2010 02:35:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:38 GMT