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

Re: File Upload Status ?

From: Alfonso Martínez de Lizarrondo <amla70@gmail.com>
Date: Thu, 23 Jul 2009 00:04:13 +0200
Message-ID: <af2a8eab0907221504kfa017caj32c350ca453edef6@mail.gmail.com>
To: public-webapps@w3.org
Although the thread is almost a year old, I haven't found any replies
to these questions, so I'm sharing what I've found:

> I have a few questions and an idea.
>
> Does calling send( file ) generate the appropriate Content-Type
> request header with matching boundary?

No, it doesn't. I've filed
https://bugs.webkit.org/show_bug.cgi?id=26979 about it.

> How can this feature be detected?

I don't think that it can be detected. You must know that the visitor
is using the correct webkit version.

> Idea:
> How about passing a form to send? When passing a form to send, the
> correct headers are set from the form's enctype, generating the
> boundary, content-disposition and other stuff for multipart requests.

Yes, that's what I thought that day after sleeping. That would be
great, much better than the option of Firefox 3.5 to read the whole
file as a string and send that. The browser takes care of reading the
file and sending it as it is needed, like any current form without
extra memory requirements.

> The only problem is that it complicates send with much functionality.
> Responsibly adaptive and well designed web apps will want to creat
> feature tests and fallback strategies, but this will be awkward and
> difficult to do, given the current API. Why not create a separate
> method - sendForm.
>
> if(xhr.sendForm)
>   xhr.sendForm(form);
>
> Garrett

That's exactly the proposal that I wanted to present to the Web Apps,
if it's possible to reuse exactly the same server code, but provide an
UI at the browser then lots of people will gladly use it. Just think
that basically the code to degrade gracefully would be
if (xhr.sendForm)
   xhr.sendForm(form);
else
   form.send();

Regards
Received on Wednesday, 22 July 2009 22:04:53 GMT

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