Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-18 Thread Jonas Sicking
On Mon, Aug 17, 2009 at 6:01 PM, Arun Ranganathana...@mozilla.com wrote: Nikunj R. Mehta wrote: On Aug 5, 2009, at 6:55 PM, Jonas Sicking wrote: What's the use-case for getAsBase64? I have another use case for this. The Atom Publishing protocol per RFC 5023 [1] accepts inline binary data

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-18 Thread Nikunj R. Mehta
On Aug 17, 2009, at 11:08 PM, Jonas Sicking wrote: On Mon, Aug 17, 2009 at 6:01 PM, Arun Ranganathana...@mozilla.com wrote: Nikunj R. Mehta wrote: On Aug 5, 2009, at 6:55 PM, Jonas Sicking wrote: What's the use-case for getAsBase64? I have another use case for this. The Atom

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-18 Thread Jonas Sicking
On Mon, Aug 17, 2009 at 11:13 PM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: On Aug 17, 2009, at 11:08 PM, Jonas Sicking wrote: On Mon, Aug 17, 2009 at 6:01 PM, Arun Ranganathana...@mozilla.com wrote: Nikunj R. Mehta wrote: On Aug 5, 2009, at 6:55 PM, Jonas Sicking wrote: What's the

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-18 Thread Arun Ranganathan
Jonas Sicking wrote: There's lots of formats used on the web, I don't think it makes sense to add file-getters for all of them. JSON has gotten a lot of attention lately, does this mean we should add a getter that return a js-style escaped string? I don't really feel very strongly about

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-18 Thread Jonas Sicking
On Tue, Aug 18, 2009 at 10:34 AM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: On Aug 17, 2009, at 11:29 PM, Jonas Sicking wrote: On Mon, Aug 17, 2009 at 11:13 PM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: On Aug 17, 2009, at 11:08 PM, Jonas Sicking wrote: On Mon, Aug 17, 2009 at

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-18 Thread Jonas Sicking
On Tue, Aug 18, 2009 at 11:25 AM, Arun Ranganathana...@mozilla.com wrote: Jonas Sicking wrote: There's lots of formats used on the web, I don't think it makes sense to add file-getters for all of them. JSON has gotten a lot of attention lately, does this mean we should add a getter that

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-18 Thread Nikunj R. Mehta
On Aug 18, 2009, at 11:50 AM, Jonas Sicking wrote: On Tue, Aug 18, 2009 at 10:34 AM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: On Aug 17, 2009, at 11:29 PM, Jonas Sicking wrote: On Mon, Aug 17, 2009 at 11:13 PM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: On Aug 17, 2009, at 11:08

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-17 Thread Nikunj R. Mehta
On Aug 12, 2009, at 7:29 AM, Arun Ranganathan wrote: Gregg Tavares wrote: How about this? Why make a new API for getting the contents of a file (local or otherwise) when we already have one which is XHR? What if FileList was just array of File objects where each File object is just a

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-17 Thread Arun Ranganathan
Nikunj R. Mehta wrote: On Aug 12, 2009, at 7:29 AM, Arun Ranganathan wrote: Gregg Tavares wrote: How about this? Why make a new API for getting the contents of a file (local or otherwise) when we already have one which is XHR? What if FileList was just array of File objects where each

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-17 Thread Michael A. Puls II
On Mon, 17 Aug 2009 20:12:50 -0400, Arun Ranganathan a...@mozilla.com wrote: Nikunj R. Mehta wrote: On Aug 12, 2009, at 7:29 AM, Arun Ranganathan wrote: Gregg Tavares wrote: How about this? Why make a new API for getting the contents of a file (local or otherwise) when we already have

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-17 Thread Arun Ranganathan
Nikunj R. Mehta wrote: On Aug 5, 2009, at 6:55 PM, Jonas Sicking wrote: What's the use-case for getAsBase64? I have another use case for this. The Atom Publishing protocol per RFC 5023 [1] accepts inline binary data represented in base 64 encoding. In order to submit binary inline

Re: [File API] events vs callbacks (was: Re: New FileAPI Draft | was Re: FileAPI feedback)

2009-08-15 Thread Jonas Sicking
On Fri, Aug 14, 2009 at 5:27 PM, Garrett Smithdhtmlkitc...@gmail.com wrote: On Fri, Aug 14, 2009 at 3:49 PM, Jonas Sickingjo...@sicking.cc wrote: On Fri, Aug 14, 2009 at 11:09 AM, Garrett Smithdhtmlkitc...@gmail.com wrote: On Mon, Aug 10, 2009 at 6:48 PM, Jonas Sickingjo...@sicking.cc wrote:

Re: [File API] events vs callbacks (was: Re: New FileAPI Draft | was Re: FileAPI feedback)

2009-08-14 Thread Garrett Smith
On Mon, Aug 10, 2009 at 6:48 PM, Jonas Sickingjo...@sicking.cc wrote: On Sat, Aug 8, 2009 at 9:37 AM, Garrett Smithdhtmlkitc...@gmail.com wrote: On Thu, Aug 6, 2009 at 11:31 AM, Jonas Sickingjo...@sicking.cc wrote: On Wed, Aug 5, 2009 at 4:26 AM, Anne van Kesterenann...@opera.com wrote: On

Re: [File API] events vs callbacks (was: Re: New FileAPI Draft | was Re: FileAPI feedback)

2009-08-14 Thread Jonas Sicking
I think at this point I would like to stop having meta-discussions about which coding pattern is the cleanest one. I think we simply disagree there. In order to move forward I think we need to compare actual proposals of APIs and see how well they solve various use cases. As far as I can see we

Re: [File API] events vs callbacks (was: Re: New FileAPI Draft | was Re: FileAPI feedback)

2009-08-14 Thread Garrett Smith
On Fri, Aug 14, 2009 at 3:49 PM, Jonas Sickingjo...@sicking.cc wrote: On Fri, Aug 14, 2009 at 11:09 AM, Garrett Smithdhtmlkitc...@gmail.com wrote: On Mon, Aug 10, 2009 at 6:48 PM, Jonas Sickingjo...@sicking.cc wrote: On Sat, Aug 8, 2009 at 9:37 AM, Garrett Smithdhtmlkitc...@gmail.com wrote:

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-12 Thread Arun Ranganathan
Gregg Tavares wrote: How about this? Why make a new API for getting the contents of a file (local or otherwise) when we already have one which is XHR? What if FileList was just array of File objects where each File object is just a URL in the format filedata: uuid, filename Then you can use

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-12 Thread Arun Ranganathan
splice should synchronously return a new FileData object. No need for asynchronous callback since no IO occurs. Done, though I used Anne's suggestion to make it an attribute. Whoops, no I didn't mean Anne's suggestion for slice -- I meant it for getAsURL. Also the current draft is:

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-12 Thread Jonas Sicking
On Wed, Aug 12, 2009 at 7:42 AM, Arun Ranganathana...@mozilla.com wrote: What's the use-case for getAsBase64? It's generally hard to encode files and to send them to servers.  While Data URLs give developers a convenient way to work with Base64, URL length limitations across user agents make

Re: [File API] events vs callbacks (was: Re: New FileAPI Draft | was Re: FileAPI feedback)

2009-08-10 Thread Jonas Sicking
On Sat, Aug 8, 2009 at 9:37 AM, Garrett Smithdhtmlkitc...@gmail.com wrote: On Thu, Aug 6, 2009 at 11:31 AM, Jonas Sickingjo...@sicking.cc wrote: On Wed, Aug 5, 2009 at 4:26 AM, Anne van Kesterenann...@opera.com wrote: On Wed, 05 Aug 2009 10:04:28 +0200, Arun Ranganathan a...@mozilla.com wrote:

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-08 Thread Anne van Kesteren
On Thu, 06 Aug 2009 22:05:55 +0200, Gregg Tavares g...@google.com wrote: well, here's an issue that NOT doing it through XMLHttpRequest seems to bring up. Say I'm writing word processor or blog posting software. I want to add the feature where the user can import an RTF file and I'm going to

Re: [File API] events vs callbacks (was: Re: New FileAPI Draft | was Re: FileAPI feedback)

2009-08-08 Thread Garrett Smith
On Thu, Aug 6, 2009 at 11:31 AM, Jonas Sickingjo...@sicking.cc wrote: On Wed, Aug 5, 2009 at 4:26 AM, Anne van Kesterenann...@opera.com wrote: On Wed, 05 Aug 2009 10:04:28 +0200, Arun Ranganathan a...@mozilla.com wrote: In the case of file read APIs, simply getting the data asynchronously is

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-06 Thread Gregg Tavares
On Wed, Aug 5, 2009 at 8:08 PM, Garrett Smith dhtmlkitc...@gmail.comwrote: On Wed, Aug 5, 2009 at 1:04 AM, Arun Ranganathana...@mozilla.com wrote: Garrett Smith wrote: Please show the subsequent use cases you've studied and please do publish your studies. What I meant by use

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-06 Thread Anne van Kesteren
On Thu, 06 Aug 2009 01:10:31 +0200, Gregg Tavares g...@google.com wrote: Why make a new API for getting the contents of a file (local or otherwise) when we already have one which is XHR? XHR does not do local data. It also does not do raw file data very well. What if FileList was just

Re: [File API] events vs callbacks (was: Re: New FileAPI Draft | was Re: FileAPI feedback)

2009-08-06 Thread Jonas Sicking
On Wed, Aug 5, 2009 at 4:26 AM, Anne van Kesterenann...@opera.com wrote: On Wed, 05 Aug 2009 10:04:28 +0200, Arun Ranganathan a...@mozilla.com wrote: In the case of file read APIs, simply getting the data asynchronously is more convenient than using events.  There is no intrigue at work here,

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-06 Thread Gregg Tavares
On Thu, Aug 6, 2009 at 2:35 AM, Anne van Kesteren ann...@opera.com wrote: On Thu, 06 Aug 2009 10:53:31 +0200, Gregg Tavares g...@google.com wrote: On Thu, Aug 6, 2009 at 12:48 AM, Anne van Kesteren ann...@opera.com wrote: XHR does not do local data. It also does not do raw file data very

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-06 Thread Jonas Sicking
On Thu, Aug 6, 2009 at 1:05 PM, Gregg Tavaresg...@google.com wrote: On Thu, Aug 6, 2009 at 2:35 AM, Anne van Kesteren ann...@opera.com wrote: On Thu, 06 Aug 2009 10:53:31 +0200, Gregg Tavares g...@google.com wrote: On Thu, Aug 6, 2009 at 12:48 AM, Anne van Kesteren ann...@opera.com wrote:

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Arun Ranganathan
Garrett Smith wrote: Please show the subsequent use cases you've studied and please do publish your studies. What I meant by use cases was this exchange: http://lists.w3.org/Archives/Public/public-webapps/2009JulSep/0371.html

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Gregg Tavares
On Wed, Aug 5, 2009 at 1:47 AM, Arun Ranganathan a...@mozilla.com wrote: Gregg Tavares wrote: I'd really like to contribute to this as I'm helping implement WebGL and we need a way to get LOTS of data into WebGL. Hundreds of files per app. That said, there's a bunch of things I don't

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Arun Ranganathan
Dmitry, the spec lists a use case about a web app that needs to send file(s) to the server programmatically. I happen to think lately about an E-mail app that can send attachments. FileData and its splice() method are useful here. I assume the XHR2 spec would get XHR.send(FileData) method.

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Arun Ranganathan
Gregg Tavares wrote The File API is meant to talk to your local file system. It isn't a network download API, but it seems that's what you want :-). Perhaps I am misunderstanding your question? Sorry, I was told on the HTML5 list that this is where network downloads and archive support

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Dmitry Titov
Hi, the spec lists a use case about a web app that needs to send file(s) to the server programmatically. I happen to think lately about an E-mail app that can send attachments. FileData and its splice() method are useful here. I assume the XHR2 spec would get XHR.send(FileData) method. XHR2

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Gregg Tavares
How about this? Why make a new API for getting the contents of a file (local or otherwise) when we already have one which is XHR? What if FileList was just array of File objects where each File object is just a URL in the format filedata: uuid, filename Then you can use that URL anywhere in

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Jonas Sicking
Oh, getAsURL should also be synchronous since no IO is occurring. / Jonas On Wed, Aug 5, 2009 at 6:55 PM, Jonas Sickingjo...@sicking.cc wrote: A few comments: Need to specify that all getAsX functions call the callback *asynchronously*. Also need to integrate this with the HTML5 event loop.

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Jonas Sicking
A few comments: Need to specify that all getAsX functions call the callback *asynchronously*. Also need to integrate this with the HTML5 event loop. getAsBinary should be called getAsBinaryString so that once we have a BinaryArray or some such we can add a getAsBinary that truly returns binary

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Garrett Smith
On Wed, Aug 5, 2009 at 1:04 AM, Arun Ranganathana...@mozilla.com wrote: Garrett Smith wrote: Please show the subsequent use cases you've studied and please do publish your studies. What I meant by use cases was this exchange:

New FileAPI Draft | was Re: FileAPI feedback

2009-08-04 Thread Arun Ranganathan
I have updated the draft of the File API, and welcome more review. Note that it is no longer called FileUpload since this term has become misleading. In particular, here are some of the issues addressed (and some not): Any reason you're using an XHTML file to edit this? Also, the