Fwd: File Upload Status ?

(put back on list)

On Fri, Aug 8, 2008 at 2:56 AM, Jonas Sicking <jonas@sicking.cc> wrote:
> Garrett Smith wrote:
>>
>> The File object is useful for uploading files via XHR. It provides
>> functionality for data to be retrieved from a file submitted to a
>> formusing the input type "file".
>>
>> It is currently a Working Draft:
>>  http://www.w3.org/TR/file-upload/
>>  http://dev.w3.org/2006/webapi/FileUpload/publish/FileUpload.html
>>
>> Implemented differently in Firefox 3.
>>  http://developer.mozilla.org/en/docs/nsIDOMFile
>>  https://bugzilla.mozilla.org/show_bug.cgi?id=371432
>>
>> An example in Firefox 3:
>> http://dhtmlkitchen.com/ape/example/form/Form.html
>>
>> It is a useful feature for in-page file upload, without resorting
>> toIFRAME hackery.
>>
>> What is the status of File Upload?
>>
>> Firefox 3's implementation is different than the w3c working draft.The
>> spec author seems to have abandoned that, so now there's a working
>> draft which seems to be collecting dust for a couple of years.
>>
>> What is going on with File Upload specification? It would be a useful
>> feature, but with only a half-legged attempt at a spec that the author
>> abandoned, and a different implementation in Firefox 3, other browsers
>> probably won't implement this functionality any time soon. It's useful
>> in Firefox 3, and would be even better if there were some mime-type
>> sniffing (mediaType).
>>
>> There seems to be a need for failing test cases,, so implementations
>> can fill in the "???"'s. Any other suggestions for getting this thing
>> done?
>
> The spec only really supplies one feature over what Firefox 3 has: The
> ability to open a file dialog strictly from Javascript without any UI
> objects involved.
>

That is not the difference I was talking about. The differences are
that Firefox 3 has three different methods that don't exist in the WD
and the WD has three methods that aren't implemented (or are renamed)
in FF3. Also, FF3 does not implement the mediaType. That would seem to
be useful to have implemented because it could allow for faster
notification of user errors.

Firefox 3:
 File
   fileName
   fileSize

   getAsBinary()
   getAsDataURL()
   getAsText()

Working Draft:
 File
   readonly attribute DOMString      fileName;
   readonly attribute DOMString      mediaType;
   readonly attribute unsigned long  fileSize;
   DOMString          getDataAsString()
                                       raises(FileException);
   DOMString          getDataAsBase64()
                                       raises(FileException);
   DOMString          getDataAsHexBinary()


(regarding FileDialog)
> I'm not sure if this is a super desirable feature from a security point of
> view. Technically speaking a site could take a users browser hostage unless
> the user agrees to give up a sensitive file:
>

Thanks for pointing that out. That's pretty nasty. It's a good case
for removing FileDialog. What is the use case for FileDialog that
can't be fulfilled by the browse button?

Garrett

>
> / Jonas
>

Received on Friday, 8 August 2008 19:24:30 UTC