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

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

From: Ryan Seddon <seddon.ryan@gmail.com>
Date: Fri, 11 Sep 2009 10:28:26 +1000
Message-ID: <255911820909101728o4da4aa0ew1e52cb6884d54379@mail.gmail.com>
To: Anne van Kesteren <annevk@opera.com>
Cc: Jian Li <jianli@chromium.org>, public-webapps@w3.org
Mozilla has something similar already called sendAsBinary though it takes a
string not an array
https://developer.mozilla.org/en/XMLHttpRequest#sendAsBinary%28%29

On Thu, Sep 10, 2009 at 7:28 PM, Anne van Kesteren <annevk@opera.com> wrote:

> On Thu, 10 Sep 2009 03:12:52 +0200, Jian Li <jianli@chromium.org> wrote:
>
>> There has already been a discussion on extending XMLHttpRequest.send() to
>> take a File object. Could we also consider enhancing it further to support
>> sending multiple files, like a FileList from the drag and drop.
>>
>> We could make XMLHttpRequest.send() take a FileList object and let the
>> browser add multipart boundary separators automatically.
>>
>> Or, the other simpler way, thanks to Darin's suggestion, is to
>> extend XMLHttpRequest.send() to take an array of items. Each of item could
>> be either a string or a file reference strictly. The web application is
>> responsible to generate the multipart enevelop like the following:
>>
>>    var payload = new Array;
>>    payload.push(header1);
>>    payload.push(file1);
>>    payload.push(footer1);
>>    ...
>>    xhr.send(payload);
>>
>> How do you guys think about these approaches?
>>
>
> The first seems a lot less error-prone for authors. I think we should go
> with that.
>
>
> --
> Anne van Kesteren
> http://annevankesteren.nl/
>
>
Received on Friday, 11 September 2009 12:45:41 GMT

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