Re: File Upload Status ?

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 UTC