Re: Proposal for an extension XMLHttpRequest to allow sending files

Maciej Stachowiak wrote:
> On Jul 17, 2008, at 1:23 PM, Aaron Boodman wrote:
> 
>>
>> Is the only difference from the Gears proposal the name of the object
>> ("File") and the lack of reading APIs initially?
> 
> The Gears proposal has a File object too, as does Mozilla's extension. 
> We are proposing making the File object usable directly as an XHR body, 
> so that we can all support file upload through XHR interoperably without 
> first having to agree on the mechanisms for reading file contents and 
> representing binary data (which are different between Gears and Mozilla).
> 
> File upload through XHR is useful even without a means to read the data 
> client-side, because combined with progress events it can provide 
> in-page progress UI with info for multiple files, which is quite a bit 
> better than what you get with form submission. Currently some web apps 
> use Flash for uploads solely to enable progress UI.
> 
> As Sam mentioned, overloading send() to take a File does not preclude 
> later overloading it to take a Blob or ByteArray or any other kind of 
> object representing raw data.

This sounds like a great idea to me.

/ Jonas

Received on Thursday, 17 July 2008 22:56:04 UTC