Re: Proposal for sending multiple files via XMLHttpRequest.send()

On Tue, 20 Oct 2009 08:55:21 +0200, Darin Fisher <darin@chromium.org>  
wrote:
> I'd like to revive the "Proposal for sending multiple files via
> XMLHttpRequest.send()" thread
> started by Jian Li back in September.
>
> As pointed out on that thread, sending a JS array of strings and File
> references isn't going
> to fly due to an array of strings already having meaning.
>
> That thread concluded with Jonas Sicking saying:
>
>> I definitely think that we need to add some way of sending a stream
>> that is a concatenation of strings, binary data, and files, without
>> requiring the files to be read.
>
> What should this look like?  Should there be a new global constructor  
> for an
> object that supports methods like appendText and appendFile?  Like this:
>
> var data = new UploadData;
> data.appendText("foo");
> data.appendFile(fileRef);
> xhr.send(data);
>
> I like the idea of creating a primitive that does not enforce any  
> encoding.
>
> Thoughts?

I think for a lot of authors the easiest would be easiest if it was in the  
form of multipart/form-data as then they do not have to do anything  
special to get the data on the server.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Tuesday, 20 October 2009 08:38:47 UTC