[whatwg] Forms: <input type=file> and directory tree picking

Glenn Maynard glenn at zewt.org
Wed Oct 2 18:51:27 PDT 2013


On Wed, Oct 2, 2013 at 7:48 PM, Jonas Sicking <jonas at sicking.cc> wrote:

> Proposals for filesystem is just part of what we need. We also need a way
>
to expose it through HtMLInputElement. And a way to allow not exposing the
> files through .files.
>

Assuming for now that we need separate modes for files and directories, I'd
suggest <input type=directory>, which causes a directory picker to be
shown, doesn't populate .files at all, and adds an API entry point to
retrieve a filesystem.  If somebody suggests an implementable way to expose
UI that doesn't need to separate files and directories then we may want
something else, but that doesn't seem likely to me.

(Implementations could still allow selecting individual files, or groups of
files, as long as it's exposed transparently as if they're files in a
directory.  So, something like type=filesystem might be a better name.)

Actually, a filesystem might not even be needed. We could just expose an
> asynchronous iterator.
>

A use case is an image viewer for photographers, allowing the user to open
a directory possibly containing tens of thousands of files.  The image
viewer should be able to allow the user to navigate through directories.
 An iterator couldn't do that--it could only grab the files in the order
they happen to come in.  Also, if the page already knows that the last
image the user viewed is "2013/sunset.jpg", and the user opens the same
directory, the page should be able to grab the same file by its filename
immediately if it still exists, without having to iterate.

Again, and with extra oomph,  proposals welcome.
>

I'd need to review the threads first, but I'll try to get to that and see
if I have any new suggestions.  The last thing I remember is movement away
from the Filesystem API, and a lighter API being proposed, but I don't
recall where that left off.

-- 
Glenn Maynard



More information about the whatwg mailing list