<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.26.3">
</HEAD>
<BODY>
On Tue, 2010-04-06 at 14:28 -0700, John Gregg wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
    The most relevant issue is that in Windows/Mac/Linux, there are no system dialogs that let the user select either a folder or a file.  They each have separate "choose a file" and "choose a folder" dialogs.  I think the logical reason for that is that when selecting a file, clicking a directory means to enter that directory and select from its files, not to choose that directory as the result of selection.
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    Thus we would force UAs to reinvent file-picker interfaces in order to deal with an input element that allows both folders and files.
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
     -John
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    On Tue, Apr 6, 2010 at 2:18 PM, Ojan Vafai <<A HREF="mailto:ojan@chromium.org">ojan@chromium.org</A>> wrote:<BR>
    <BLOCKQUOTE>
        It's unfortunate that users need to distinguish between single and multiple file inputs. That's not something we can change at this point. The web started with single file inputs. We can avoid adding a third type of file input they need to understand though.
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        Also, what should happen if you drag files and folders onto a "multiple" or "directory" input? Just drop the ones that are of the wrong type? I cannot imagine users making sense of that.
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        It's not clear to me from your original email what issues you encountered during implementation that led to this proposal. Is it just the leaf name conflict issue? I agree that's a problem, but maybe there's a different solution to that?
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <FONT COLOR="#888888">Ojan</FONT>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        On Tue, Apr 6, 2010 at 12:53 PM, John Gregg <<A HREF="mailto:johnnyg@google.com">johnnyg@google.com</A>> wrote:
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            That's a fair question, but how is it clear today whether an input can accept multiple files vs. a single file using drag-and-drop?  Currently if I drag multiple files onto an input that doesn't have 'multiple', I get only the first one.  (In Chrome.)
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BR>
            <BR>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            Some good default text from the UA, like "Choose folder..." instead of "Choose file...", would go far to solve that, I think.
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BR>
            <BR>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <FONT COLOR="#888888"> -John</FONT>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BR>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BR>
            <BR>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            On Tue, Apr 6, 2010 at 12:38 PM, Ojan Vafai <<A HREF="mailto:ojan@chromium.org">ojan@chromium.org</A>> wrote:<BR>
            <BLOCKQUOTE>
                What about drag-drop? I should be able to drag a directory, a file, or a list of files onto an input, no? If not, how is this distinction shown to users? How will it be clear to users when they can do one or the other?
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <BR>
                <BR>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <FONT COLOR="#888888">Ojan</FONT>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <BR>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <BR>
                <BR>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                On Thu, Apr 1, 2010 at 3:53 PM, John Gregg <<A HREF="mailto:johnnyg@google.com">johnnyg@google.com</A>> wrote:<BR>
                <BLOCKQUOTE>
                    For context, Ian Fette started a thread about uploading directories of files in December: <A HREF="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-December/024455.html">http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-December/024455.html</A> <BR>
                    <BR>
                    At that time, it was thought that directory upload could be implemented by a UA in response to a <input type="file" multiple> tag using different UI only, and modifying the FileAPI spec to allow path information in the form<BR>
                    <BR>
                    input.files[0].name="1.jpg"<BR>
                    input.files[0].path="a"<BR>
                    input.files[1].name="2.jpg"<BR>
                    input.files[1].path="a/b"<BR>
                    input.files[2].name="3.jpg"<BR>
                    input.files[2].path="a/c"<BR>
                    <BR>
                    I've started developing a prototype of this in WebKit/Chromium.  Based on what I've encountered so far, I would like to propose adding directory upload functionality using an explicit new 'directory' attribute on the file input element. 
                </BLOCKQUOTE>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <BLOCKQUOTE>
                    <BR>
                    <BR>
                </BLOCKQUOTE>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <BLOCKQUOTE>
                    The existing behavior of <input type="file" multiple> would not change, but when processing <input type="file" directory>, the UA would display a directory selection UI and store the path information, and <I>not</I> allow individual files to be selected.  It would allow multiple files to have the same leaf name (.name attribute), as long as the paths were different.  The path attributes would include the name of the chosen directory <BR>
                    <BR>
                    This would be preferable for several reasons:<BR>
                     - Most built-in file system UI on major platforms (Windows/Mac/Linux) have distinct dialogs for choosing files and choosing directories.  Allowing the UA to use these directly makes sense rather than creating hybrids.<BR>
                     - Avoiding "leaf name" conflicts in a directory tree is not feasible in many applications -- asking a user to ensure unique photo names in a large set of albums before uploading would fail to meet that use case.  Therefore HTML documents should know in advance whether the path information will be relevant in the eventual storage of the files.  Sites currently using <input type="file" multiple> would have compatibility problems with an implementation which allowed conflicting file names along different paths.
                </BLOCKQUOTE>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <BLOCKQUOTE>
                    <BR>
                    <BR>
                </BLOCKQUOTE>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <BLOCKQUOTE>
                    What are your thoughts about adding the 'directory' attribute?
                </BLOCKQUOTE>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <BLOCKQUOTE>
                    <BR>
                    <BR>
                </BLOCKQUOTE>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <BLOCKQUOTE>
                    Thanks,
                </BLOCKQUOTE>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BLOCKQUOTE>
            <BLOCKQUOTE>
                <BLOCKQUOTE>
                     -John
                </BLOCKQUOTE>
            </BLOCKQUOTE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BR>
It gets even more complex than that; in Linux, the various different window managers generally tend to have their own way of doing things, so you have Gnome, KDE, etc as well to deal with.<BR>
<BR>
Plus, you can get KDE on Windows too, so it's potentially an issue there as well.
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
Thanks,<BR>
Ash<BR>
<A HREF="http://www.ashleysheridan.co.uk">http://www.ashleysheridan.co.uk</A><BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>