<div class="gmail_quote">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.)</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Some good default text from the UA, like "Choose folder..." instead of "Choose file...", would go far to solve that, I think.</div><div class="gmail_quote">
<br></div><div class="gmail_quote"> -John</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Tue, Apr 6, 2010 at 12:38 PM, Ojan Vafai <span dir="ltr"><<a href="mailto:ojan@chromium.org">ojan@chromium.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">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?<div>
<br></div><div><font color="#888888">Ojan</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Thu, Apr 1, 2010 at 3:53 PM, John Gregg <span dir="ltr"><<a href="mailto:johnnyg@google.com" target="_blank">johnnyg@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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" target="_blank">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. <div>
<br></div><div>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.</div>
<div><div>
<br></div><div>What are your thoughts about adding the 'directory' attribute?</div><div><br></div><div>Thanks,</div><div> -John</div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br>