File API, Editor's Draft II

I'd like review on the most recent draft of the File API (renamed from 
"FileUpload API") [1].  There's been a great deal of interest in the 
File API from different quarters[2], and I look forward to feedback on 
how to represent file lists, file objects (and accessors), file 
selection dialogs, and file errors.   A few issues and considerations:

1. File data APIs behave asynchronously, which was initial feedback.  
This specification only defines two data accessor methods, but I note 
that asynchronous callbacks seem like they may proliferate, especially 
for error handling.  I'm not sure we can totally avoid this, except to 
be as economical as possible.

2. It continues to be useful to have a mechanism to programmatically 
spawn a file picker, in addition to the HTML input type="file" 
mechanism.  Well known web applications are using Flash to do this, and 
it would be nice if this capability was part of the open web platform.  
This mechanism can be used to prompt for "on they fly" file generation 
by hardware-resident capabilities such as a device's camera.  I've 
specified this in my editor's draft [1] and think it could be 
implemented as a property on the window object, but I'm interested to 
hear opinions about whether it should be something with a constructor, 
*and* whether other user agent organizations think this should be a 
feature mitigated with a user interaction layer, which blocks by default 
till the user grants permission.  This also behaves asynchronously, and 
adds to the issue in 1. 

3. I'd like discussion of FileError objects.  We may need multiple error 
interfaces, or at least more nuanced error codes.  In particular, I'd 
like commentary on security considerations mentioned in the spec.

A few things in my latest editor's draft [1]aren't done, but it's ready 
for feedback.
 

-- A*
[1] http://dev.w3.org/2006/webapi/FileUpload/publish/FileAPI.xhtml
[2] 
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-June/020302.html
 

Received on Thursday, 11 June 2009 10:35:11 UTC