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: Wed, 14 Apr 2010 12:04:10 -0700
Message-ID: <i2yfa2eab051004141204oa34f0056h5e708cf5f7de7685@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Dmitry Titov <dimich@google.com>, Web Applications Working Group WG <public-webapps@w3.org>
On Tue, Apr 13, 2010 at 9:01 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Tue, Apr 13, 2010 at 7:35 PM, Michael Nordman <michaeln@google.com>
> wrote:
> > 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.
> There seems to be general agreement (based on various discussions here
> and on whatwg) that the .type property should be moved to the Blob
> interface. So Blobs will have a content-type. So this problem should
> be taken care of.
> / Jonas

Yes indeed!

So are we saying that FormData.toBlob() produces a blob representing the
results and having a .type property of the form...
 multipart/form-data; boundary=xxxxxxx

[Constructor] interface FormData { Blob toBlob (); void append(DOMString
name, Blob value); void append(DOMString name, DOMString value); };

Also it looks like BlobBuilder (in the draft dimich linked to) is lacking a
means for the caller to set the type attribute of the blob being built.
A couple ways that could be provided...

[Constructor] interface BlobBuilder { attribute DOMString endings;
attribute DOMString type; // option a
Blob getBlob (in DOMString type); // option b void append (in DOMString
text) raises (FileException); void append (in Blob data); };
Received on Wednesday, 14 April 2010 19:04:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:07 UTC