- From: Garrett Smith <dhtmlkitchen@gmail.com>
- Date: Tue, 2 Sep 2008 15:12:33 -0700
- To: "Maciej Stachowiak" <mjs@apple.com>
- Cc: "Oliver Hunt" <oliver@apple.com>, "Web Applications Working Group WG" <public-webapps@w3.org>, "Jonas Sicking" <jonas@sicking.cc>
Just wanted to follow up with this. How can we proceed with getting some file serialization implemented? I would like to create some tests. Should there be async/sync, or just async? I'm sure it's going to be a useful feature. Jonas was also helping flesh out some ideas for Form Serialization, so we could have something like:- var form = document.forms[0]; form.enctype="multipart/form-data"; form.getDataAsString(); form.enctype = "application/x-www-form-urlencoded"; form.getQueryString(); This would be useful mostly for getting the data (including from type="file") to an XHR without having to resort to IFRAME hacks. It seems that the File Serialization would be the hardest part of that problem. If File serialization can be accomplished, wouldn't serializing the whole form be relatively easy? I'd like to get started with File Serialization. If the Webkit guys are too busy with other things at the moment, then maybe Mozilla can take the initiative. Thanks, Garrett On Sun, Aug 24, 2008 at 11:25 PM, Garrett Smith <dhtmlkitchen@gmail.com> wrote: > Oliver, Maciej - have you given this any thought? > > I'd like to get some discussion going for this. I'll write the failing > tests, but I need some vendor input. That goes for Jonas, Boris, and > other Mozilla guys, too. > > Thanks, > > Garrett > > On Tue, Aug 12, 2008 at 10:23 PM, Garrett Smith <dhtmlkitchen@gmail.com> wrote: >> On Tue, Aug 12, 2008 at 8:01 PM, Maciej Stachowiak <mjs@apple.com> wrote: >>> >>> On Aug 11, 2008, at 11:21 PM, Garrett Smith wrote: >>> >> >> [snip] >> >>>> Why don't you post up your ideas? >>> >>> We'll probably make a proposal for async reads in time. Our initial >>> implementation in WebKit only lets you upload a File object via XHR but we >>> believe eventually some form of direct I/O should be added. >>> >> >> I have a few questions and an idea. >> >> Does calling send( file ) generate the appropriate Content-Type >> request header with matching boundary? >> >> How can this feature be detected? >> >> 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. >> >> 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 >> >>> Regards, >>> Maciej >>> >>> >>> >>> >> >
Received on Tuesday, 2 September 2008 22:13:15 UTC