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 &lt;input type=&quot;file&quot; multiple&gt; tag using different UI only, and modifying the FileAPI spec to allow path information in the form<br>

<br>input.files[0].name=&quot;1.jpg&quot;<br>input.files[0].path=&quot;a&quot;<br>input.files[1].name=&quot;2.jpg&quot;<br>input.files[1].path=&quot;a/b&quot;<br>input.files[2].name=&quot;3.jpg&quot;<br>input.files[2].path=&quot;a/c&quot;<br>

<br>I&#39;ve started developing a prototype of this in WebKit/Chromium.  Based on what I&#39;ve encountered so far, I would like to propose adding directory upload functionality using an explicit new &#39;directory&#39; attribute on the file input element. <div>

<br></div><div>The existing behavior of &lt;input type=&quot;file&quot; multiple&gt; would not change, but when processing &lt;input type=&quot;file&quot; directory&gt;, 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 &quot;leaf name&quot; 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 &lt;input type=&quot;file&quot; multiple&gt; 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 &#39;directory&#39; attribute?</div><div><br></div><div>Thanks,</div><div> -John</div></div>