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. Mehta wrote: On Aug 17, 2009, at 11:29 PM, Jonas Sicking wrote: On Mon, Aug 17, 2009 at 11:13 PM, Nikunj R. Mehta wrote: On Aug 17, 2009, at 11:08 PM, Jonas Sicking wrote: On Mon, Aug 17, 2009

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-18 Thread Jonas Sicking
On Tue, Aug 18, 2009 at 11:25 AM, Arun Ranganathan 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 return

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. Mehta wrote: > > On Aug 17, 2009, at 11:29 PM, Jonas Sicking wrote: > >> On Mon, Aug 17, 2009 at 11:13 PM, Nikunj R. >> Mehta wrote: >>> >>> On Aug 17, 2009, at 11:08 PM, Jonas Sicking wrote: >>> On Mon, Aug 17, 2009 at 6:01 PM, Arun Ranganathan

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 Nikunj R. Mehta
On Aug 17, 2009, at 11:29 PM, Jonas Sicking wrote: On Mon, Aug 17, 2009 at 11:13 PM, Nikunj R. Mehta wrote: On Aug 17, 2009, at 11:08 PM, Jonas Sicking wrote: On Mon, Aug 17, 2009 at 6:01 PM, Arun Ranganathan wrote: Nikunj R. Mehta wrote: On Aug 5, 2009, at 6:55 PM, Jonas Sicking wrote

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-17 Thread Jonas Sicking
On Mon, Aug 17, 2009 at 11:13 PM, Nikunj R. Mehta wrote: > > On Aug 17, 2009, at 11:08 PM, Jonas Sicking wrote: > >> On Mon, Aug 17, 2009 at 6:01 PM, Arun Ranganathan wrote: >>> >>> Nikunj R. Mehta wrote: On Aug 5, 2009, at 6:55 PM, Jonas Sicking wrote: > What's the use-case for

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-17 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 Ranganathan 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

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-17 Thread Jonas Sicking
On Mon, Aug 17, 2009 at 6:01 PM, Arun Ranganathan 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-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 content

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 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 one which is XHR?

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 Fil

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-17 Thread Nikunj R. Mehta
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 content in an Atom entry to a

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 U

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 Smith wrote: > On Fri, Aug 14, 2009 at 3:49 PM, Jonas Sicking wrote: > >> On Fri, Aug 14, 2009 at 11:09 AM, Garrett Smith >> wrote: >>> On Mon, Aug 10, 2009 at 6:48 PM, Jonas Sicking wrote: On Sat, Aug 8, 2009 at 9:37 AM, Garrett Smith wrote: >>>

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 Sicking wrote: > On Fri, Aug 14, 2009 at 11:09 AM, Garrett Smith wrote: >> On Mon, Aug 10, 2009 at 6:48 PM, Jonas Sicking wrote: >>> On Sat, Aug 8, 2009 at 9:37 AM, Garrett Smith wrote: On Thu, Aug 6, 2009 at 11:31 AM, Jonas Sicking wrote: > On Wed,

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 ha

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 Sicking wrote: > On Sat, Aug 8, 2009 at 9:37 AM, Garrett Smith wrote: >> On Thu, Aug 6, 2009 at 11:31 AM, Jonas Sicking wrote: >>> On Wed, Aug 5, 2009 at 4:26 AM, Anne van Kesteren wrote: On Wed, 05 Aug 2009 10:04:28 +0200, Arun Ranganathan wrote: >

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-12 Thread Jonas Sicking
On Wed, Aug 12, 2009 at 7:42 AM, Arun Ranganathan 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 it pretty t

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: http

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-12 Thread Arun Ranganathan
Jonas Sicking 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. Done. getAsBinary should be called getAsBinaryString so that once we have a BinaryArray or some such we can add a getAsBi

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: [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 Smith wrote: > On Thu, Aug 6, 2009 at 11:31 AM, Jonas Sicking wrote: >> On Wed, Aug 5, 2009 at 4:26 AM, Anne van Kesteren wrote: >>> On Wed, 05 Aug 2009 10:04:28 +0200, Arun Ranganathan >>> wrote: In the case of file read APIs, simply getting the d

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 Sicking wrote: > On Wed, Aug 5, 2009 at 4:26 AM, Anne van Kesteren wrote: >> On Wed, 05 Aug 2009 10:04:28 +0200, Arun Ranganathan >> wrote: >>> >>> In the case of file read APIs, simply getting the data asynchronously is >>> more convenient than using events.

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 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 parse the file

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-06 Thread Jonas Sicking
On Thu, Aug 6, 2009 at 1:05 PM, Gregg Tavares wrote: > > > On Thu, Aug 6, 2009 at 2:35 AM, Anne van Kesteren wrote: >> >> On Thu, 06 Aug 2009 10:53:31 +0200, Gregg Tavares wrote: >>> >>> On Thu, Aug 6, 2009 at 12:48 AM, Anne van Kesteren >>> wrote: XHR does not do local data. It also d

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 wrote: > On Thu, 06 Aug 2009 10:53:31 +0200, Gregg Tavares wrote: > >> On Thu, Aug 6, 2009 at 12:48 AM, Anne van Kesteren >> wrote: >> >>> XHR does not do local data. It also does not do raw file data very well. >>> >> >> I don't quite understan

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 Kesteren wrote: > On Wed, 05 Aug 2009 10:04:28 +0200, Arun Ranganathan > 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, >> merely disagreement.

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-06 Thread Anne van Kesteren
On Thu, 06 Aug 2009 10:53:31 +0200, Gregg Tavares wrote: On Thu, Aug 6, 2009 at 12:48 AM, Anne van Kesteren wrote: XHR does not do local data. It also does not do raw file data very well. I don't quite understand this comment. Isn't the point of these discussions how to extend browsers an

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-06 Thread Gregg Tavares
On Thu, Aug 6, 2009 at 12:48 AM, Anne van Kesteren wrote: > On Thu, 06 Aug 2009 01:10:31 +0200, Gregg Tavares 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 ra

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 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 array of File object

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Gregg Tavares
On Wed, Aug 5, 2009 at 8:08 PM, Garrett Smith wrote: > On Wed, Aug 5, 2009 at 1:04 AM, Arun Ranganathan 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 exch

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Garrett Smith
On Wed, Aug 5, 2009 at 1:04 AM, Arun Ranganathan 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: > > http://lists.w3.org/Archives/Public/public-webapps/2009JulSep/

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 da

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 Sicking 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. > > getAsBi

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 H

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 provid

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 suppor

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. XHR2

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Anne van Kesteren
On Wed, 05 Aug 2009 10:59:46 +0200, Gregg Tavares wrote: Sorry, I was told on the HTML5 list that this is where network downloads and archive support stuff belonged. It certain seems like a good fit to me. That is true, but it seems you conflate networking with files. Networking is the do

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

2009-08-05 Thread Anne van Kesteren
On Wed, 05 Aug 2009 10:04:28 +0200, Arun Ranganathan 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, merely disagreement. I could imagine that for reading data you might want to have even

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 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 understand

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Arun Ranganathan
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 understand about the API *) Given that XMLHttpRequest is limited to a same domain p

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Gregg Tavares
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 understand about the API *) Given that XMLHttpRequest is limited to a same domain policy but the img tag,

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 http://lists.w3.org/Archives/Public/public-webapps/2009JulSep/

Re: New FileAPI Draft | was Re: FileAPI feedback

2009-08-05 Thread Garrett Smith
On Tue, Aug 4, 2009 at 6:55 PM, Arun Ranganathan wrote: > 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 re

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 indent