W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: [XHR2] Blobs, names and FormData

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 18 Jul 2011 15:00:44 -0700
Message-ID: <CA+c2ei8yDmooFknyNytQS0+LYKuBxHBTimxME0nHhY4u4_yFjw@mail.gmail.com>
To: Charles Pritchard <chuck@jumis.com>
Cc: Adrian Bateman <adrianba@microsoft.com>, Anne van Kesteren <annevk@opera.com>, Julian Reschke <julian.reschke@gmx.de>, Alfonso Martínez de Lizarrondo <amla70@gmail.com>, Webapps WG <public-webapps@w3.org>
On Mon, Jul 18, 2011 at 2:52 PM, Charles Pritchard <chuck@jumis.com> wrote:
> On 7/18/2011 2:42 PM, Jonas Sicking wrote:
>>>
>>> >  If there is an API that replies on File to
>>> >  work correctly we think we should fix it to work with Blob. For
>>> > example, FileReader is
>>> >  really BlobReader and works fine with Blobs. To me, getFile() should
>>> > be unnecessary and
>>> >  the best fix for FormData is to just modify append for this situation.
>>
>> While File and Blob are indeed very similar, they are also not the
>> same thing. I think being able to create files is an easy addition for
>> implementations, while it means not restricting getting Files from the
>> users file system. So if you have code that expects to read a File
>> from IndexedDB, the page can either populate that from the users
>> filesystem, or by generating the data manually and using
>> BlobBuilder.getFile.
>
> I'm very interested in this use case; I've been told that there may be
> issues
> with IndexedDB transaction constraints and FileReader/writer.
>
> Afaik, filewriter doesn't apply to blobs in this case. I don't know the
> consequences of
> callbacks to reader functions in the event loop, and whether that would end
> up "blocking"
> idb events. I'd imagine the blob is simply reset, and the stale reference
> remains until it can
> be cleaned up.

Note that File objects are immutable just like Blobs are, so none of
this applies here.

The issues that you're talking about come up once we start talking
about FileEntries, but that's an entirely different beast which are
unrelated to this thread. No-one has suggested being able to create a
FileEntry using BlobBuilder, nor that FileEntries are required to
submit named content using FormData.

Hope that helps.

/ Jonas
Received on Monday, 18 July 2011 22:01:44 GMT

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