Re: FormData and BlobBuilder - duplication of functionality?

On Thu, Apr 15, 2010 at 5:20 PM, Kinuko Yasuda <kinuko@chromium.org> wrote:
>>> > [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); };
>>>
>>> I don't feel strongly, but "option b" looks cleaner to me. Might want
>>> to make the argument optional though, and default to the empty string.
>>
>> Option b works for me and agreed it should be optional with empty being
>> the default value.
>
> I prefer option b as well.  (Especially if there'll be a use case where
> users want to change the 'type' each time they call getBlob())
> What will be the default type of Blob when it's not specified?

The empty string.

> In this generally agreed proposal, if we append a blob made by FormData to
> another FormData, we will be getting a nested multipart data, right?

Yes.

/ Jonas

Received on Friday, 16 April 2010 00:35:20 UTC