[whatwg] Expose event.dataTransfer.files accessor to allow file drag and drop

Thomas Broyer t.broyer at gmail.com
Wed Jun 10 03:30:06 PDT 2009


On Wed, Jun 10, 2009 at 10:37 AM, Adam Barth wrote:
> SUMMARY
>
> Currently the <input> element exposes selected files via a "files"
> accessor (i.e., as in https://developer.mozilla.org/En/NsIDOMFileList
> and http://www.w3.org/TR/file-upload/).  We should add a similar
> accessor to event.dataTransfer to enable drag-and-drop of files onto
> web pages.
[...]
> Alternative APIs include getData('File'), as defined in
> http://msdn.microsoft.com/en-us/library/ms537658(VS.85).aspx.
> However, it does not appear that IE ever implemented this API.  (Also,
> note that IE doesn't follow HTML 5's clipboard security model.)
> Mozilla has an equivalent API in
> event.dataTransfer.mozGetDataAt("application/x-moz-file", 0).

It should be noted also that Adobe AIR has
getData("application/x-vnd.adobe.air.file-list") [1] and Gears
(starting with 0.5.21.0, as announced at Google I/O) has its own (not
yet documented) API with a "files" property [2] (as requested here).


[1] http://help.adobe.com/en_US/AIR/1.5/devappshtml/WS7709855E-7162-45d1-8224-3D4DADC1B2D7.html
[2] http://code.google.com/p/gears/source/browse/trunk/gears/test/manual/drag_and_drop.html#109

-- 
Thomas Broyer



More information about the whatwg mailing list