W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2010

[whatwg] Directory upload via <input type="file" directory>

From: J Ross Nicoll <jrn@jrn.me.uk>
Date: Sat, 24 Apr 2010 09:47:07 +0100
Message-ID: <4BD2B00B.5040508@jrn.me.uk>
The API doesn't officially seem to cover dragging and dropping directories.

The implementation in Firefox is to allow directories to be dropped into 
the browser along with files. It passes them to the script with an empty 
type attribute, and attempts to read them produce a directory listing. 
However, I don't believe this gives the script the ability to read the 
files within a dropped directory (it knows where they are, but is 
constrained by the sandbox).

I would suggest this is something the drag & drop API needs to be 
expanded to cover explicitly; perhaps have "isDirectory" and "files" 
attributes on the File object, to indicate that a file reference is 
actually a directory, and to access the contents of that directory 
respectively.

Anne van Kesteren wrote:
> On Fri, 23 Apr 2010 07:11:08 +0900, Ojan Vafai <ojan at chromium.org> wrote:
>> But there is already a default UI that lets you select a folder, a 
>> file or both (drag-drop). I don't see why this forces the UA to do 
>> anything. Just
>> because you can select both folders and files doesn't mean the UA 
>> needs to expose extra UI on top of drag-drop to let you do so. Again, 
>> no more so than they already have to expose extra UI to deal with 
>> multiple inputs.
> 
> How does the drag & drop API support this use case?
> 
> 
Received on Saturday, 24 April 2010 01:47:07 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:22 UTC