<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.whatwg.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kinuko</id>
	<title>WHATWG Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.whatwg.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kinuko"/>
	<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/wiki/Special:Contributions/Kinuko"/>
	<updated>2026-05-10T00:18:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8344</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8344"/>
		<updated>2012-06-24T16:54:12Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Benefits */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element &amp;lt;ref&amp;gt;http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&amp;lt;/ref&amp;gt; and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object&amp;lt;ref&amp;gt;http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&amp;lt;/ref&amp;gt;.  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
Since we didn&#039;t use to have a good interface to represent directories/folders, all webapps could access for file drag-and-drop was one or multiple files given as &#039;&#039;&#039;File&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
On the other hand, this API proposes returning &#039;&#039;&#039;Entry&#039;&#039;&#039; instances &amp;lt;ref&amp;gt;http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-entry-interface&amp;lt;/ref&amp;gt;, which can represent either file or directory.  Via the &#039;&#039;&#039;Entry&#039;&#039;&#039; interface webapps can easily distinguish if a dropped entity is a file or directory by examining &#039;.isFile&#039; or &#039;.isDirectory&#039; field of the entry.  If the entry is a directory, webapps can recursively walk over nested files and directories included in the directory by calling &#039;.readEntries()&#039; method of the directory reader for the entry.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== Benefits ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Enables folder drag-and-drop&#039;&#039;&#039;: Most obvious and direct advantage of this API is it enables folder/directories drag-and-drop both in &amp;lt;input type=file&amp;gt; and HTML5 native drag-and-drop, which was purely not possible in the current HTML5 specification.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Enables folders/files mixtured drag-and-drop&#039;&#039;&#039;: Similarly, since &#039;&#039;&#039;Entry&#039;&#039;&#039; interface can represent files and directories, the API naturally enables more advanced mixed cases in drag-and-drop, like multiple folders, multiple folders and files and so on.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Gives webapps full control of when and what to traverse&#039;&#039;&#039;: Unlike previous proposals for folder drag-and-drop&amp;lt;ref&amp;gt;http://lists.w3.org/Archives/Public/public-whatwg-archive/2010Apr/0240.html&amp;lt;/ref&amp;gt;, this approach does not require full-traversal of the dropped folder(s) by the user agent, but instead simply exposes an interface with which webapps can asynchronously interact with the dropped folder(s).  This gives the webapps a greater control of when and what to traverse directories, or when to stop the traversal, or how to &#039;&#039;show a neat progress indicator&#039;&#039; to the users.  This also means that users no longer need to worry about sluggish browser behavior when s/he has wrongly dropped a directory which contains a millions of nested files/directories.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Gives webapps direct read-only access to the user&#039;s local file tree&#039;&#039;&#039;: Since the API exposes a selected user&#039;s local folder with its complete tree structure, it opens up various interesting possibilities to webapps which was not possible without accessing directory structures. E.g. importing a user&#039;s Photos folders with album-like subfolders to a photo-album app, importing a user&#039;s source code tree to a web-based IDE, showing a nice file browser on a dropped media drive in a cover-flow like interface etc.&lt;br /&gt;
&lt;br /&gt;
=== HTMLInputElement.entries ===&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== DataTransferItem.getAsEntry() ===&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is &#039;&#039;&#039;read-only&#039;&#039;&#039;, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry in isolated filesystem &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).   The dropped entries are only accessible while the app has live instance for the entries.&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
  &lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
 &lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
  &lt;br /&gt;
       var entry = items[i].webkitGetAsEntry();    // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 21)&lt;br /&gt;
   &lt;br /&gt;
      // import the dropped files/folders into temporary filesystem&lt;br /&gt;
      entry.copyTo(temporaryFs.root, entry.name, successCallback, errorCallback);&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
  &lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
  &lt;br /&gt;
     var entries = e.target.webkitEntries;        // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 22)&lt;br /&gt;
  &lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8343</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8343"/>
		<updated>2012-06-24T16:52:13Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element &amp;lt;ref&amp;gt;http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&amp;lt;/ref&amp;gt; and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object&amp;lt;ref&amp;gt;http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&amp;lt;/ref&amp;gt;.  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
Since we didn&#039;t use to have a good interface to represent directories/folders, all webapps could access for file drag-and-drop was one or multiple files given as &#039;&#039;&#039;File&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
On the other hand, this API proposes returning &#039;&#039;&#039;Entry&#039;&#039;&#039; instances &amp;lt;ref&amp;gt;http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-entry-interface&amp;lt;/ref&amp;gt;, which can represent either file or directory.  Via the &#039;&#039;&#039;Entry&#039;&#039;&#039; interface webapps can easily distinguish if a dropped entity is a file or directory by examining &#039;.isFile&#039; or &#039;.isDirectory&#039; field of the entry.  If the entry is a directory, webapps can recursively walk over nested files and directories included in the directory by calling &#039;.readEntries()&#039; method of the directory reader for the entry.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== Benefits ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Enables folder drag-and-drop&#039;&#039;&#039;: Most obvious and direct advantage of this API is it enables folder/directories drag-and-drop both in &amp;lt;input type=file&amp;gt; and HTML5 native drag-and-drop, which was purely not possible in the current HTML5 specification.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Enables folders/files mixtured drag-and-drop&#039;&#039;&#039;: Similarly, since &#039;&#039;&#039;Entry&#039;&#039;&#039; interface can represent files and directories, the API naturally enables more advanced mixed cases in drag-and-drop, like multiple folders, multiple folders and files and so on.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Gives webapps full control of when and what to traverse&#039;&#039;&#039;: Unlike previous proposals for folder drag-and-drop&amp;lt;ref&amp;gt;http://lists.w3.org/Archives/Public/public-whatwg-archive/2010Apr/0240.html&amp;lt;/ref&amp;gt;, this approach does not require full-traversal of the dropped folder(s) by the user agent, but instead simply exposes an interface with which webapps can asynchronously interact with the dropped folder(s).  This gives the webapps a greater control of when and what to traverse directories, or when to stop the traversal, or how to show a progress indicator to the users.  This also means that users no longer need to worry about sluggish browser behavior when s/he has wrongly dropped a directory which contains a millions of nested files/directories.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Gives webapps direct read-only access to the user&#039;s local file system&#039;&#039;&#039;: Since the API exposes a selected user&#039;s local folder with its complete tree structure, it opens up various interesting possibilities to webapps which was not possible without accessing directory structures. E.g. importing a user&#039;s Photos folders with album-like subfolders to a photo-album app, importing a user&#039;s source code tree to a web-based IDE, showing a nice file browser on a dropped media drive etc.&lt;br /&gt;
&lt;br /&gt;
=== HTMLInputElement.entries ===&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== DataTransferItem.getAsEntry() ===&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is &#039;&#039;&#039;read-only&#039;&#039;&#039;, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry in isolated filesystem &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).   The dropped entries are only accessible while the app has live instance for the entries.&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
  &lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
 &lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
  &lt;br /&gt;
       var entry = items[i].webkitGetAsEntry();    // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 21)&lt;br /&gt;
   &lt;br /&gt;
      // import the dropped files/folders into temporary filesystem&lt;br /&gt;
      entry.copyTo(temporaryFs.root, entry.name, successCallback, errorCallback);&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
  &lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
  &lt;br /&gt;
     var entries = e.target.webkitEntries;        // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 22)&lt;br /&gt;
  &lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8342</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8342"/>
		<updated>2012-06-24T16:49:26Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since we didn&#039;t use to have a good interface to represent directories/folders, all webapps could access for file drag-and-drop was one or multiple files given as &#039;&#039;&#039;File&#039;&#039;&#039; objects.&lt;br /&gt;
&lt;br /&gt;
On the other hand, this API proposes returning &#039;&#039;&#039;Entry&#039;&#039;&#039; instances (http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-entry-interface), which can represent either file or directory.  Via the &#039;&#039;&#039;Entry&#039;&#039;&#039; interface webapps can easily distinguish if a dropped entity is a file or directory by examining &#039;.isFile&#039; or &#039;.isDirectory&#039; field of the entry.  If the entry is a directory, webapps can recursively walk over nested files and directories included in the directory by calling &#039;.readEntries()&#039; method of the directory reader for the entry.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== Benefits ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Enables folder drag-and-drop&#039;&#039;&#039;: Most obvious and direct advantage of this API is it enables folder/directories drag-and-drop both in &amp;lt;input type=file&amp;gt; and HTML5 native drag-and-drop, which was purely not possible in the current HTML5 specification.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Enables folders/files mixtured drag-and-drop&#039;&#039;&#039;: Similarly, since &#039;&#039;&#039;Entry&#039;&#039;&#039; interface can represent files and directories, the API naturally enables more advanced mixed cases in drag-and-drop, like multiple folders, multiple folders and files and so on.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Gives webapps full control of when and what to traverse&#039;&#039;&#039;: Unlike previous proposals for folder drag-and-drop [1], this approach does not require full-traversal of the dropped folder(s) by the user agent, but instead simply exposes an interface with which webapps can asynchronously interact with the dropped folder(s).  This gives the webapps a greater control of when and what to traverse directories, or when to stop the traversal, or how to show a progress indicator to the users.  This also means that users no longer need to worry about sluggish browser behavior when s/he has wrongly dropped a directory which contains a millions of nested files/directories.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Gives webapps direct read-only access to the user&#039;s local file system&#039;&#039;&#039;: Since the API exposes a selected user&#039;s local folder with its complete tree structure, it opens up various interesting possibilities to webapps which was not possible without accessing directory structures. E.g. importing a user&#039;s Photos folders with album-like subfolders to a photo-album app, importing a user&#039;s source code tree to a web-based IDE, showing a nice file browser on a dropped media drive etc.&lt;br /&gt;
&lt;br /&gt;
[1] http://lists.w3.org/Archives/Public/public-whatwg-archive/2010Apr/0240.html&lt;br /&gt;
&lt;br /&gt;
=== HTMLInputElement.entries ===&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== DataTransferItem.getAsEntry() ===&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is &#039;&#039;&#039;read-only&#039;&#039;&#039;, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry in isolated filesystem &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).   The dropped entries are only accessible while the app has live instance for the entries.&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
  &lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
 &lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
  &lt;br /&gt;
       var entry = items[i].webkitGetAsEntry();    // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 21)&lt;br /&gt;
   &lt;br /&gt;
      // import the dropped files/folders into temporary filesystem&lt;br /&gt;
      entry.copyTo(temporaryFs.root, entry.name, successCallback, errorCallback);&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
  &lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
  &lt;br /&gt;
     var entries = e.target.webkitEntries;        // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 22)&lt;br /&gt;
  &lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8338</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8338"/>
		<updated>2012-06-20T15:39:24Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Isolated FileSystem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== HTMLInputElement.entries ===&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== DataTransferItem.getAsEntry() ===&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is &#039;&#039;&#039;read-only&#039;&#039;&#039;, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry in isolated filesystem &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).   The dropped entries are only accessible while the app has live instance for the entries.&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
  &lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
 &lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
  &lt;br /&gt;
       var entry = items[i].webkitGetAsEntry();    // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 21)&lt;br /&gt;
   &lt;br /&gt;
      // import the dropped files/folders into temporary filesystem&lt;br /&gt;
      entry.copyTo(temporaryFs.root, entry.name, successCallback, errorCallback);&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
  &lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
  &lt;br /&gt;
     var entries = e.target.webkitEntries;        // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 22)&lt;br /&gt;
  &lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8337</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8337"/>
		<updated>2012-06-20T12:52:37Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Example Code (Input) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== HTMLInputElement.entries ===&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== DataTransferItem.getAsEntry() ===&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry in isolated filesystem &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).   The dropped entries are only accessible while the app has live instance for the entries.&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
  &lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
 &lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
  &lt;br /&gt;
       var entry = items[i].webkitGetAsEntry();    // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 21)&lt;br /&gt;
   &lt;br /&gt;
      // import the dropped files/folders into temporary filesystem&lt;br /&gt;
      entry.copyTo(temporaryFs.root, entry.name, successCallback, errorCallback);&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
  &lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
  &lt;br /&gt;
     var entries = e.target.webkitEntries;        // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 22)&lt;br /&gt;
  &lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8336</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8336"/>
		<updated>2012-06-20T12:52:20Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Example Code (Drag and Drop) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== HTMLInputElement.entries ===&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== DataTransferItem.getAsEntry() ===&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry in isolated filesystem &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).   The dropped entries are only accessible while the app has live instance for the entries.&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
  &lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
 &lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
  &lt;br /&gt;
       var entry = items[i].webkitGetAsEntry();    // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 21)&lt;br /&gt;
   &lt;br /&gt;
      // import the dropped files/folders into temporary filesystem&lt;br /&gt;
      entry.copyTo(temporaryFs.root, entry.name, successCallback, errorCallback);&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.webkitEntries;        // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 22)&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8335</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8335"/>
		<updated>2012-06-20T12:51:47Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Example Code (Drag and Drop) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== HTMLInputElement.entries ===&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== DataTransferItem.getAsEntry() ===&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry in isolated filesystem &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).   The dropped entries are only accessible while the app has live instance for the entries.&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
  &lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
 &lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
 &lt;br /&gt;
       var entry = items[i].webkitGetAsEntry();    // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 21)&lt;br /&gt;
       entry.copyTo(temporaryFs.root, entry.name, successCallback, errorCallback);   // import the dropped files/folders into temporary filesystem&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.webkitEntries;        // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 22)&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8334</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8334"/>
		<updated>2012-06-20T12:17:41Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== HTMLInputElement.entries ===&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== DataTransferItem.getAsEntry() ===&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry in isolated filesystem &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).   The dropped entries are only accessible while the app has live instance for the entries.&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
       var entry = items[i].webkitGetAsEntry();    // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 21)&lt;br /&gt;
       if (entry.isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entry);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.webkitEntries;        // WebKit/chromium needs &#039;webkit&#039; prefix (since Chrome 22)&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8333</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8333"/>
		<updated>2012-06-20T12:06:17Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Proposing API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== HTMLInputElement.entries ===&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
=== DataTransferItem.getAsEntry() ===&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry in isolated filesystem &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).   The dropped entries are only accessible while the app has live instance for the entries.&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
       var entry = items[i].getAsEntry();&lt;br /&gt;
       if (entry.isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entry);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.entries;&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8332</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8332"/>
		<updated>2012-06-20T12:05:11Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Restrictions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry in isolated filesystem &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).   The dropped entries are only accessible while the app has live instance for the entries.&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
       var entry = items[i].getAsEntry();&lt;br /&gt;
       if (entry.isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entry);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.entries;&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8323</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8323"/>
		<updated>2012-06-18T14:48:20Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Restrictions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).  [TBD: toURL() should be probably supported when we solve the lifetime issue when it crosses script execution contexts possibly via structured cloning]&lt;br /&gt;
* The Entry&#039;s &#039;&#039;&#039;fullPath does not (and should not) expose the file&#039;s full platform path&#039;&#039;&#039; as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
       var entry = items[i].getAsEntry();&lt;br /&gt;
       if (entry.isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entry);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.entries;&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8322</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8322"/>
		<updated>2012-06-18T04:18:41Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
=== Restrictions ===&lt;br /&gt;
&lt;br /&gt;
* The Entry &#039;&#039;&#039;does not support toURL()&#039;&#039;&#039; or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).  [TBD: toURL() should be probably supported when we solve the lifetime issue when it crosses script execution contexts possibly via structured cloning]&lt;br /&gt;
* The Entry&#039;s fullPath does not (and should not) expose the file or directory&#039;s full platform path as it could contain a sensitive information.  Instead it MAY contain a relative path to the top directory that the user dropped. &lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
       var entry = items[i].getAsEntry();&lt;br /&gt;
       if (entry.isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entry);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.entries;&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8313</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8313"/>
		<updated>2012-06-15T18:48:08Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support (this proposal was originally proposed on whatwg mailing list).&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
[2] Original proposal email: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
The Entry does not support toURL() or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
       var entry = items[i].getAsEntry();&lt;br /&gt;
       if (entry.isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entry);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.entries;&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8312</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8312"/>
		<updated>2012-06-15T18:46:53Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support.&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposing API ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
== Isolated FileSystem ==&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
The Entry does not support toURL() or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
       var entry = items[i].getAsEntry();&lt;br /&gt;
       if (entry.isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entry);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.entries;&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8311</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8311"/>
		<updated>2012-06-15T18:46:08Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Example Code (Drag and Drop) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support.&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposal ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== Isolated FileSystem ===&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
The Entry does not support toURL() or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).&lt;br /&gt;
&lt;br /&gt;
=== Usage Scenario ===&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
       var entry = items[i].getAsEntry();&lt;br /&gt;
       if (entry.isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entry);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.entries;&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8310</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8310"/>
		<updated>2012-06-15T18:45:55Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Example Code (Input) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support.&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposal ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== Isolated FileSystem ===&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
The Entry does not support toURL() or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).&lt;br /&gt;
&lt;br /&gt;
=== Usage Scenario ===&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
&lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
       var entry = items[i].getAsEntry();&lt;br /&gt;
       if (entry.isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entry);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.entries;&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8309</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8309"/>
		<updated>2012-06-15T18:45:30Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Proposal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support.&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposal ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element [1] and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object [2].  Populate the field with or return an &#039;Entry&#039; object defined in FileSystem API upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
[2] http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
=== Isolated FileSystem ===&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
The Entry does not support toURL() or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).&lt;br /&gt;
&lt;br /&gt;
=== Usage Scenario ===&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Drag and Drop) ===&lt;br /&gt;
&lt;br /&gt;
   var droptarget = document.getElementById(&#039;droptarget&#039;);&lt;br /&gt;
&lt;br /&gt;
   droptarget.addEventListener(&#039;dop&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var items = e.dataTransfer.items;&lt;br /&gt;
     for (var i = 0; i &amp;lt; items.length; ++i) { &lt;br /&gt;
       if (items[i].kind != &amp;quot;file&amp;quot;)&lt;br /&gt;
          continue;&lt;br /&gt;
       var entry = items[i].getAsEntry();&lt;br /&gt;
       if (entry.isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entry);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
=== Example Code (Input) ===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;input type=&amp;quot;file&amp;quot; multiple /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   var input = document.querySelector(&amp;quot;input[type=&#039;file&#039;]&amp;quot;);&lt;br /&gt;
   input.addEventListener(&#039;change&#039;, function (e) {&lt;br /&gt;
     e.stopPropagation();&lt;br /&gt;
     e.preventDefault();&lt;br /&gt;
     var entries = e.target.entries;&lt;br /&gt;
     for (var i = 0; i &amp;lt; entries.length; ++i) { &lt;br /&gt;
       if (entries[i].isDirectory) {&lt;br /&gt;
         traverseDirectoryTree(entry);&lt;br /&gt;
       } else {&lt;br /&gt;
         showFileEntry(entries[i]);&lt;br /&gt;
       }&lt;br /&gt;
   });&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8308</id>
		<title>DragAndDropEntries</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=DragAndDropEntries&amp;diff=8308"/>
		<updated>2012-06-15T18:36:48Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: Created page with &amp;#039;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support.  [1] File API: Directories and Sys...&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing exposing dropped files/folders as {File,Directory}Entry defined in FileSystem API [1] for better folders/files drag-and-drop support.&lt;br /&gt;
&lt;br /&gt;
[1] File API: Directories and System http://www.w3.org/TR/file-system-api/&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Many sites have &#039;upload your files&#039; feature, like for your photo images.  HTML5 allows you to do this via &amp;lt;input type=&amp;quot;file&amp;quot; multiple&amp;gt; or drag-and-drop feature, but the current solution does not provide clean solution for cases with folders, files/folder mixed cases, or folders with subfolders cases.&lt;br /&gt;
&lt;br /&gt;
== Proposal ==&lt;br /&gt;
&lt;br /&gt;
Add a new field &#039;entries&#039; to &amp;lt;input type=files&amp;gt; element and a new accessor method &#039;getAsEntry()&#039; to DataTransferItem object, and populate the field with or return a file or directory &#039;Entry&#039; defined in FileSystem API [1] upon file selection or drop events.&lt;br /&gt;
&lt;br /&gt;
Since FileSystem API naturally supports tree-structured folder hierarchy, Entry object exposes handy fields like &#039;isFile&#039; and &#039;isDirectory&#039;, and allows webapps to recursively walk over the nested entries in subfolders via ReadDirectory() method.&lt;br /&gt;
&lt;br /&gt;
This approach allows webapps to directly interact with the local folder structure, and also allows them to control the enumerating part so that the apps can show nice progress meter if they want.&lt;br /&gt;
&lt;br /&gt;
  interface HTMLInputElement : HTMLElement {&lt;br /&gt;
     // allows scripts to access the element&#039;s selected files as an array of Entry defined in FileSystem API.&lt;br /&gt;
     // On getting, if the IDL attribute applies, it must return a Entry array that represents the current selected files and/or folders.&lt;br /&gt;
     // If the IDL attribute does not apply, then it must instead return null.&lt;br /&gt;
     // Unless the multiple attribute is set, there must be no more than one file in the list of selected files.&lt;br /&gt;
     readonly attribute Entry[] entries;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#file-upload-state-(type=file)&lt;br /&gt;
&lt;br /&gt;
  interface DataTransferItem {&lt;br /&gt;
    // Like DataTransferItem.getAsFile(), getAsEntry() method runs following steps:&lt;br /&gt;
    // 1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.&lt;br /&gt;
    // 2. If the drag data item kind is not File, then return null and abort these steps.&lt;br /&gt;
    // 3. Return a new Entry object representing the actual file or directory represented by the DataTransferItem object.&lt;br /&gt;
    Entry getAsEntry();&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitem-interface&lt;br /&gt;
&lt;br /&gt;
=== Isolated FileSystem ===&lt;br /&gt;
&lt;br /&gt;
The Entry exposed by this feature is created in an &#039;&#039;&#039;Isolated&#039;&#039;&#039; filesystem, which is read-only, isolated and transient.  The filesystem only contains the dropped items and can only be accessed by the site where the drag-and-drop event has happened.  Webapps cannot access any other files or folders outside the filesystem.&lt;br /&gt;
&lt;br /&gt;
The Entry does not support toURL() or is not resolvable by resolveFileSystemURL(), since its filesystem is transient and has limited life time (while toURL URL&#039;s do not work as live references like Blob URLs).&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Assume a user has following files and folders in his/her &#039;Photos&#039; folder:&lt;br /&gt;
&lt;br /&gt;
    /Users/username/Photos/trip/1.jpg&lt;br /&gt;
    /Users/username/Photos/trip/2.jpg&lt;br /&gt;
    /Users/username/Photos/trip/3.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/a.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2011/b.jpg&lt;br /&gt;
    /Users/username/Photos/halloween/2012/plan.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/1.jpg&lt;br /&gt;
    /Users/username/Photos/tokyo/2.jpg&lt;br /&gt;
 &lt;br /&gt;
When the user drag-and-drops or selects the two folders, &#039;&#039;&#039;trip&#039;&#039;&#039;, &#039;&#039;&#039;halloween&#039;&#039;&#039; and one photo file &#039;&#039;&#039;tokyo/1.jpg&#039;&#039;&#039;, the webapp will get following entries via &#039;entries&#039; field of the input element or via DataTransferItem.getAsEntry():&lt;br /&gt;
&lt;br /&gt;
    DirectoryEntry for &#039;trip&#039;,&lt;br /&gt;
    DirectoryEntry for &#039;halloween&#039;&lt;br /&gt;
    FileEntry for &#039;1.jpg&#039;&lt;br /&gt;
&lt;br /&gt;
Via the new &#039;entries&#039; field the app can access children files or subfolders in the selected entries, and can properly organize and process pictures using the local folder structure.  Even if the dropped directory is on a slow removable media, or it contains tons of subdirectories and files, the app can recursively traverse each of them while showing a nice progress information, or can show an interactive file tree which lets the user freely expand or select some of the contents. &lt;br /&gt;
&lt;br /&gt;
We can think of similar interesting usage scenarios like local-cloud sync app or bulk &#039;importer&#039;, e.g. importing local source directory to cloud IDE etc.&lt;br /&gt;
&lt;br /&gt;
=== Example Code ===&lt;br /&gt;
&lt;br /&gt;
(coming soon)&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=Quota&amp;diff=8307</id>
		<title>Quota</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=Quota&amp;diff=8307"/>
		<updated>2012-06-15T17:50:59Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing Quota management API for offline storage APIs&lt;br /&gt;
&lt;br /&gt;
Note: now the proposal draft is moved to: https://dvcs.w3.org/hg/quota/raw-file/tip/Overview.html&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Today we have a lot of useful offline storage APIs (including proposing/obsolete ones), i.e. IndexedDB, FileSystem API, AppCache and SQL DB, but the storage allocation decision for the offline storage APIs has been a big unresolved pain among the UA.&lt;br /&gt;
This proposal is to establish a clear protocol between apps, the UA and the user so that the UA can make an appropriate decision about how much it should allocate the storage and about whether the UA could delete the offline data at its discretion or not.&lt;br /&gt;
&lt;br /&gt;
The proposal is:&lt;br /&gt;
&lt;br /&gt;
# introduce two different storage categories, &#039;&#039;&#039;temporary/evictable/transient&#039;&#039;&#039; and &#039;&#039;&#039;persistent/non-evictable&#039;&#039;&#039;.&lt;br /&gt;
#* The &#039;&#039;&#039;temporary&#039;&#039;&#039; storage can be viewed as &#039;/tmp&#039; space in the traditional filesystem, and can be used without explicit quota request but the data may get deleted at any time at the UA&#039;s discretion.&lt;br /&gt;
#* The &#039;&#039;&#039;persistent&#039;&#039;&#039; storage should never deleted by the UA without the user’s instruction, but should require up-front quota request to use, which may in turn require explicit user intervention.&lt;br /&gt;
# introduce a new app-facing API to request or query quota/usage.  The API includes two primary methods, one is to &#039;&#039;&#039;request more (persistent) storage quota&#039;&#039;&#039; and the other is to &#039;&#039;&#039;query the current quota and used amount&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The requested or granted quota should work in a unified way across different storage APIs, so that apps do not need to take care of storage space for each API.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
  Window implements QuotaStorageEnvironment; &lt;br /&gt;
  [NoInterfaceObject] &lt;br /&gt;
  interface QuotaStorageEnvironment {&lt;br /&gt;
    readonly attribute StorageInfo storageInfo; &lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
=== StorageInfo interface ===&lt;br /&gt;
&lt;br /&gt;
  interface StorageInfo {&lt;br /&gt;
    const unsigned short TEMPORARY = 0; &lt;br /&gt;
    const unsigned short PERSISTENT = 1; &lt;br /&gt;
  &lt;br /&gt;
    // Queries the current quota and how much data is stored for the host. &lt;br /&gt;
    void queryUsageAndQuota( &lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        optional StorageInfoUsageCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  &lt;br /&gt;
    // Requests a new quota.  Requesting a larger quota may require user&#039;s &lt;br /&gt;
    // explicit permission via UI prompting / infobar. &lt;br /&gt;
    void requestQuota(&lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        unsigned long long newQuotaInBytes, &lt;br /&gt;
        optional StorageInfoQuotaCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoUsageCallback { &lt;br /&gt;
    void handleEvent(unsigned long long currentUsageInBytes, &lt;br /&gt;
                               unsigned long long currentQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoQuotaCallback { &lt;br /&gt;
    void handleEvent(unsigned long long grantedQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoErrorCallback { &lt;br /&gt;
    void handleEvent(DOMCoreException error); &lt;br /&gt;
  }; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes about TEMPORARY / PERSISTENT storageType const values: in general using string would be more preferable than enum, but for now we&#039;re proposing short const values to make it match with the type parameters of [http://www.w3.org/TR/file-system-api/ File API: Directories and System].&lt;br /&gt;
&lt;br /&gt;
=== Example Code ===&lt;br /&gt;
&lt;br /&gt;
The app can get the current quota and usage for the apps&#039; origin by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.queryUsageAndQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,    // or TEMPORARY&lt;br /&gt;
    function (usage, quota) { log(&amp;quot;Current usage/quota:&amp;quot; + usage + &amp;quot;/&amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Querying quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
The app can also request more quota by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.requestQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,&lt;br /&gt;
    requestingQuota,&lt;br /&gt;
    function (quota) { log(&amp;quot;Requested &amp;quot; + requestingQuota + &amp;quot; =&amp;gt; got &amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Requesting quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=Quota&amp;diff=7834</id>
		<title>Quota</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=Quota&amp;diff=7834"/>
		<updated>2011-12-14T06:00:02Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* StorageInfo interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing Quota management API for offline storage APIs&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Today we have a lot of useful offline storage APIs (including proposing/obsolete ones), i.e. IndexedDB, FileSystem API, AppCache and SQL DB, but the storage allocation decision for the offline storage APIs has been a big unresolved pain among the UA.&lt;br /&gt;
This proposal is to establish a clear protocol between apps, the UA and the user so that the UA can make an appropriate decision about how much it should allocate the storage and about whether the UA could delete the offline data at its discretion or not.&lt;br /&gt;
&lt;br /&gt;
The proposal is:&lt;br /&gt;
&lt;br /&gt;
# introduce two different storage categories, &#039;&#039;&#039;temporary/evictable/transient&#039;&#039;&#039; and &#039;&#039;&#039;persistent/non-evictable&#039;&#039;&#039;.&lt;br /&gt;
#* The &#039;&#039;&#039;temporary&#039;&#039;&#039; storage can be viewed as &#039;/tmp&#039; space in the traditional filesystem, and can be used without explicit quota request but the data may get deleted at any time at the UA&#039;s discretion.&lt;br /&gt;
#* The &#039;&#039;&#039;persistent&#039;&#039;&#039; storage should never deleted by the UA without the user’s instruction, but should require up-front quota request to use, which may in turn require explicit user intervention.&lt;br /&gt;
# introduce a new app-facing API to request or query quota/usage.  The API includes two primary methods, one is to &#039;&#039;&#039;request more (persistent) storage quota&#039;&#039;&#039; and the other is to &#039;&#039;&#039;query the current quota and used amount&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The requested or granted quota should work in a unified way across different storage APIs, so that apps do not need to take care of storage space for each API.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
  Window implements QuotaStorageEnvironment; &lt;br /&gt;
  [NoInterfaceObject] &lt;br /&gt;
  interface QuotaStorageEnvironment {&lt;br /&gt;
    readonly attribute StorageInfo storageInfo; &lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
=== StorageInfo interface ===&lt;br /&gt;
&lt;br /&gt;
  interface StorageInfo {&lt;br /&gt;
    const unsigned short TEMPORARY = 0; &lt;br /&gt;
    const unsigned short PERSISTENT = 1; &lt;br /&gt;
  &lt;br /&gt;
    // Queries the current quota and how much data is stored for the host. &lt;br /&gt;
    void queryUsageAndQuota( &lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        optional StorageInfoUsageCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  &lt;br /&gt;
    // Requests a new quota.  Requesting a larger quota may require user&#039;s &lt;br /&gt;
    // explicit permission via UI prompting / infobar. &lt;br /&gt;
    void requestQuota(&lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        unsigned long long newQuotaInBytes, &lt;br /&gt;
        optional StorageInfoQuotaCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoUsageCallback { &lt;br /&gt;
    void handleEvent(unsigned long long currentUsageInBytes, &lt;br /&gt;
                               unsigned long long currentQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoQuotaCallback { &lt;br /&gt;
    void handleEvent(unsigned long long grantedQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoErrorCallback { &lt;br /&gt;
    void handleEvent(DOMCoreException error); &lt;br /&gt;
  }; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes about TEMPORARY / PERSISTENT storageType const values: in general using string would be more preferable than enum, but for now we&#039;re proposing short const values to make it match with the type parameters of [http://www.w3.org/TR/file-system-api/ File API: Directories and System].&lt;br /&gt;
&lt;br /&gt;
=== Example Code ===&lt;br /&gt;
&lt;br /&gt;
The app can get the current quota and usage for the apps&#039; origin by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.queryUsageAndQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,    // or TEMPORARY&lt;br /&gt;
    function (usage, quota) { log(&amp;quot;Current usage/quota:&amp;quot; + usage + &amp;quot;/&amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Querying quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
The app can also request more quota by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.requestQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,&lt;br /&gt;
    requestingQuota,&lt;br /&gt;
    function (quota) { log(&amp;quot;Requested &amp;quot; + requestingQuota + &amp;quot; =&amp;gt; got &amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Requesting quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=Quota&amp;diff=7832</id>
		<title>Quota</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=Quota&amp;diff=7832"/>
		<updated>2011-12-13T04:53:17Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing Quota management API for offline storage APIs&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Today we have a lot of useful offline storage APIs (including proposing/obsolete ones), i.e. IndexedDB, FileSystem API, AppCache and SQL DB, but the storage allocation decision for the offline storage APIs has been a big unresolved pain among the UA.&lt;br /&gt;
This proposal is to establish a clear protocol between apps, the UA and the user so that the UA can make an appropriate decision about how much it should allocate the storage and about whether the UA could delete the offline data at its discretion or not.&lt;br /&gt;
&lt;br /&gt;
The proposal is:&lt;br /&gt;
&lt;br /&gt;
# introduce two different storage categories, &#039;&#039;&#039;temporary/evictable/transient&#039;&#039;&#039; and &#039;&#039;&#039;persistent/non-evictable&#039;&#039;&#039;.&lt;br /&gt;
#* The &#039;&#039;&#039;temporary&#039;&#039;&#039; storage can be viewed as &#039;/tmp&#039; space in the traditional filesystem, and can be used without explicit quota request but the data may get deleted at any time at the UA&#039;s discretion.&lt;br /&gt;
#* The &#039;&#039;&#039;persistent&#039;&#039;&#039; storage should never deleted by the UA without the user’s instruction, but should require up-front quota request to use, which may in turn require explicit user intervention.&lt;br /&gt;
# introduce a new app-facing API to request or query quota/usage.  The API includes two primary methods, one is to &#039;&#039;&#039;request more (persistent) storage quota&#039;&#039;&#039; and the other is to &#039;&#039;&#039;query the current quota and used amount&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The requested or granted quota should work in a unified way across different storage APIs, so that apps do not need to take care of storage space for each API.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
  Window implements QuotaStorageEnvironment; &lt;br /&gt;
  [NoInterfaceObject] &lt;br /&gt;
  interface QuotaStorageEnvironment {&lt;br /&gt;
    readonly attribute StorageInfo storageInfo; &lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
=== StorageInfo interface ===&lt;br /&gt;
&lt;br /&gt;
  interface StorageInfo {&lt;br /&gt;
    const unsigned short TEMPORARY = 0; &lt;br /&gt;
    const unsigned short PERSISTENT = 1; &lt;br /&gt;
  &lt;br /&gt;
    // Queries the current quota and how much data is stored for the host. &lt;br /&gt;
    void queryUsageAndQuota( &lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        optional StorageInfoUsageCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  &lt;br /&gt;
    // Requests a new quota.  Requesting a larger quota may require user&#039;s &lt;br /&gt;
    // explicit permission via UI prompting / infobar. &lt;br /&gt;
    void requestQuota(&lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        unsigned long long newQuotaInBytes, &lt;br /&gt;
        optional StorageInfoQuotaCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoUsageCallback { &lt;br /&gt;
    void handleEvent(unsigned long long currentUsageInBytes, &lt;br /&gt;
                               unsigned long long currentQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoQuotaCallback { &lt;br /&gt;
    void handleEvent(unsigned long long grantedQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
&lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoErrorCallback { &lt;br /&gt;
    void handleEvent(DOMCoreException error); &lt;br /&gt;
  }; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes about TEMPORARY / PERSISTENT storageType const values: in general using string would be more preferable than enum, but for now we&#039;re proposing short const values to make it match with the type parameters of [http://www.w3.org/TR/file-system-api/ File API: Directories and System].&lt;br /&gt;
&lt;br /&gt;
=== Example Code ===&lt;br /&gt;
&lt;br /&gt;
The app can get the current quota and usage for the apps&#039; origin by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.queryUsageAndQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,    // or TEMPORARY&lt;br /&gt;
    function (usage, quota) { log(&amp;quot;Current usage/quota:&amp;quot; + usage + &amp;quot;/&amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Querying quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
The app can also request more quota by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.requestQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,&lt;br /&gt;
    requestingQuota,&lt;br /&gt;
    function (quota) { log(&amp;quot;Requested &amp;quot; + requestingQuota + &amp;quot; =&amp;gt; got &amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Requesting quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=Quota&amp;diff=7831</id>
		<title>Quota</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=Quota&amp;diff=7831"/>
		<updated>2011-12-13T04:48:26Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: /* Example Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing Quota management API for offline storage APIs&lt;br /&gt;
&lt;br /&gt;
== Editors ==&lt;br /&gt;
&lt;br /&gt;
* Kinuko Yasuda (Google, Inc)&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Today we have a lot of useful offline storage APIs (including proposing/obsolete ones), i.e. IndexedDB, FileSystem API, AppCache and SQL DB, but the storage allocation decision for the offline storage APIs has been a big unresolved pain among the UA.&lt;br /&gt;
This proposal is to establish a clear protocol between apps, the UA and the user so that the UA can make an appropriate decision about how much it should allocate the storage and about whether the UA could delete the offline data at its discretion or not.&lt;br /&gt;
&lt;br /&gt;
The proposal is:&lt;br /&gt;
&lt;br /&gt;
# introduce two different storage categories, &#039;&#039;&#039;temporary/evictable/transient&#039;&#039;&#039; and &#039;&#039;&#039;persistent/non-evictable&#039;&#039;&#039;.&lt;br /&gt;
#* The &#039;&#039;&#039;temporary&#039;&#039;&#039; storage can be viewed as &#039;/tmp&#039; space in the traditional filesystem, and can be used without explicit quota request but the data may get deleted at any time at the UA&#039;s discretion.&lt;br /&gt;
#* The &#039;&#039;&#039;persistent&#039;&#039;&#039; storage should never deleted by the UA without the user’s instruction, but should require up-front quota request to use, which may in turn require explicit user intervention.&lt;br /&gt;
# introduce a new app-facing API to request or query quota/usage.  The API includes two primary methods, one is to &#039;&#039;&#039;request more (persistent) storage quota&#039;&#039;&#039; and the other is to &#039;&#039;&#039;query the current quota and used amount&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The requested or granted quota should work in a unified way across different storage APIs, so that apps do not need to take care of storage space for each API.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
  Window implements QuotaStorageEnvironment; &lt;br /&gt;
  [NoInterfaceObject] &lt;br /&gt;
  interface QuotaStorageEnvironment {&lt;br /&gt;
    readonly attribute StorageInfo storageInfo; &lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
=== StorageInfo interface ===&lt;br /&gt;
&lt;br /&gt;
  interface StorageInfo {&lt;br /&gt;
    const unsigned short TEMPORARY = 0; &lt;br /&gt;
    const unsigned short PERSISTENT = 1; &lt;br /&gt;
  &lt;br /&gt;
    // Queries the current quota and how much data is stored for the host. &lt;br /&gt;
    void queryUsageAndQuota( &lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        optional StorageInfoUsageCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  &lt;br /&gt;
    // Requests a new quota.  Requesting a larger quota may require user&#039;s &lt;br /&gt;
    // explicit permission via UI prompting / infobar. &lt;br /&gt;
    void requestQuota(&lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        unsigned long long newQuotaInBytes, &lt;br /&gt;
        optional StorageInfoQuotaCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoUsageCallback { &lt;br /&gt;
    void handleEvent(unsigned long long currentUsageInBytes, &lt;br /&gt;
                               unsigned long long currentQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoQuotaCallback { &lt;br /&gt;
    void handleEvent(unsigned long long grantedQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
&lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoErrorCallback { &lt;br /&gt;
    void handleEvent(DOMCoreException error); &lt;br /&gt;
  }; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes about TEMPORARY / PERSISTENT storageType const values: in general using string would be more preferable than enum, but for now we&#039;re proposing short const values to make it match with the type parameters of [http://www.w3.org/TR/file-system-api/ File API: Directories and System].&lt;br /&gt;
&lt;br /&gt;
=== Example Code ===&lt;br /&gt;
&lt;br /&gt;
The app can get the current quota and usage for the apps&#039; origin by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.queryUsageAndQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,    // or TEMPORARY&lt;br /&gt;
    function (usage, quota) { log(&amp;quot;Current usage/quota:&amp;quot; + usage + &amp;quot;/&amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Querying quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
The app can also request more quota by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.requestQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,&lt;br /&gt;
    requestingQuota,&lt;br /&gt;
    function (quota) { log(&amp;quot;Requested &amp;quot; + requestingQuota + &amp;quot; =&amp;gt; got &amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Requesting quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=Quota&amp;diff=7830</id>
		<title>Quota</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=Quota&amp;diff=7830"/>
		<updated>2011-12-13T04:47:36Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing Quota management API for offline storage APIs&lt;br /&gt;
&lt;br /&gt;
== Editors ==&lt;br /&gt;
&lt;br /&gt;
* Kinuko Yasuda (Google, Inc)&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Today we have a lot of useful offline storage APIs (including proposing/obsolete ones), i.e. IndexedDB, FileSystem API, AppCache and SQL DB, but the storage allocation decision for the offline storage APIs has been a big unresolved pain among the UA.&lt;br /&gt;
This proposal is to establish a clear protocol between apps, the UA and the user so that the UA can make an appropriate decision about how much it should allocate the storage and about whether the UA could delete the offline data at its discretion or not.&lt;br /&gt;
&lt;br /&gt;
The proposal is:&lt;br /&gt;
&lt;br /&gt;
# introduce two different storage categories, &#039;&#039;&#039;temporary/evictable/transient&#039;&#039;&#039; and &#039;&#039;&#039;persistent/non-evictable&#039;&#039;&#039;.&lt;br /&gt;
#* The &#039;&#039;&#039;temporary&#039;&#039;&#039; storage can be viewed as &#039;/tmp&#039; space in the traditional filesystem, and can be used without explicit quota request but the data may get deleted at any time at the UA&#039;s discretion.&lt;br /&gt;
#* The &#039;&#039;&#039;persistent&#039;&#039;&#039; storage should never deleted by the UA without the user’s instruction, but should require up-front quota request to use, which may in turn require explicit user intervention.&lt;br /&gt;
# introduce a new app-facing API to request or query quota/usage.  The API includes two primary methods, one is to &#039;&#039;&#039;request more (persistent) storage quota&#039;&#039;&#039; and the other is to &#039;&#039;&#039;query the current quota and used amount&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The requested or granted quota should work in a unified way across different storage APIs, so that apps do not need to take care of storage space for each API.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
  Window implements QuotaStorageEnvironment; &lt;br /&gt;
  [NoInterfaceObject] &lt;br /&gt;
  interface QuotaStorageEnvironment {&lt;br /&gt;
    readonly attribute StorageInfo storageInfo; &lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
=== StorageInfo interface ===&lt;br /&gt;
&lt;br /&gt;
  interface StorageInfo {&lt;br /&gt;
    const unsigned short TEMPORARY = 0; &lt;br /&gt;
    const unsigned short PERSISTENT = 1; &lt;br /&gt;
  &lt;br /&gt;
    // Queries the current quota and how much data is stored for the host. &lt;br /&gt;
    void queryUsageAndQuota( &lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        optional StorageInfoUsageCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  &lt;br /&gt;
    // Requests a new quota.  Requesting a larger quota may require user&#039;s &lt;br /&gt;
    // explicit permission via UI prompting / infobar. &lt;br /&gt;
    void requestQuota(&lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        unsigned long long newQuotaInBytes, &lt;br /&gt;
        optional StorageInfoQuotaCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoUsageCallback { &lt;br /&gt;
    void handleEvent(unsigned long long currentUsageInBytes, &lt;br /&gt;
                               unsigned long long currentQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoQuotaCallback { &lt;br /&gt;
    void handleEvent(unsigned long long grantedQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
&lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoErrorCallback { &lt;br /&gt;
    void handleEvent(DOMCoreException error); &lt;br /&gt;
  }; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes about TEMPORARY / PERSISTENT storageType const values: in general using string would be more preferable than enum, but for now we&#039;re proposing short const values to make it match with the type parameters of [http://www.w3.org/TR/file-system-api/ File API: Directories and System].&lt;br /&gt;
&lt;br /&gt;
=== Example Code ===&lt;br /&gt;
&lt;br /&gt;
The app can get the current quota and usage for the apps&#039; origin by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.queryUsageAndQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,    // or TEMPORARY&lt;br /&gt;
    function (usage, quota) { log(&amp;quot;Current usage/quota:&amp;quot; + usage + &amp;quot;/&amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Querying quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
The app can also request more quota by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.requestQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,&lt;br /&gt;
    requestingQuota,&lt;br /&gt;
    function (quota) { log(&amp;quot;Requested &amp;quot; + requestingQuota + &amp;quot; =&amp;gt; got &amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Requesting quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposals|Categories]]&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=Quota&amp;diff=7829</id>
		<title>Quota</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=Quota&amp;diff=7829"/>
		<updated>2011-12-13T04:44:54Z</updated>

		<summary type="html">&lt;p&gt;Kinuko: Quota management API proposal&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Proposing Quota management API for offline storage APIs&lt;br /&gt;
&lt;br /&gt;
== Editors ==&lt;br /&gt;
&lt;br /&gt;
* Kinuko Yasuda (Google, Inc)&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
Today we have a lot of useful offline storage APIs (including proposing/obsolete ones), i.e. IndexedDB, FileSystem API, AppCache and SQL DB, but the storage allocation decision for the offline storage APIs has been a big unresolved pain among the UA.&lt;br /&gt;
This proposal is to establish a clear protocol between apps, the UA and the user so that the UA can make an appropriate decision about how much it should allocate the storage and about whether the UA could delete the offline data at its discretion or not.&lt;br /&gt;
&lt;br /&gt;
The proposal is:&lt;br /&gt;
&lt;br /&gt;
# introduce two different storage categories, &#039;&#039;&#039;temporary/evictable/transient&#039;&#039;&#039; and &#039;&#039;&#039;persistent/non-evictable&#039;&#039;&#039;.&lt;br /&gt;
#* The &#039;&#039;&#039;temporary&#039;&#039;&#039; storage can be viewed as &#039;/tmp&#039; space in the traditional filesystem, and can be used without explicit quota request but the data may get deleted at any time at the UA&#039;s discretion.&lt;br /&gt;
#* The &#039;&#039;&#039;persistent&#039;&#039;&#039; storage should never deleted by the UA without the user’s instruction, but should require up-front quota request to use, which may in turn require explicit user intervention.&lt;br /&gt;
# introduce a new app-facing API to request or query quota/usage.  The API includes two primary methods, one is to &#039;&#039;&#039;request more (persistent) storage quota&#039;&#039;&#039; and the other is to &#039;&#039;&#039;query the current quota and used amount&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The requested or granted quota should work in a unified way across different storage APIs, so that apps do not need to take care of storage space for each API.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
  Window implements QuotaStorageEnvironment; &lt;br /&gt;
  [NoInterfaceObject] &lt;br /&gt;
  interface QuotaStorageEnvironment {&lt;br /&gt;
    readonly attribute StorageInfo storageInfo; &lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
=== StorageInfo interface ===&lt;br /&gt;
&lt;br /&gt;
  interface StorageInfo {&lt;br /&gt;
    const unsigned short TEMPORARY = 0; &lt;br /&gt;
    const unsigned short PERSISTENT = 1; &lt;br /&gt;
  &lt;br /&gt;
    // Queries the current quota and how much data is stored for the host. &lt;br /&gt;
    void queryUsageAndQuota( &lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        optional StorageInfoUsageCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  &lt;br /&gt;
    // Requests a new quota.  Requesting a larger quota may require user&#039;s &lt;br /&gt;
    // explicit permission via UI prompting / infobar. &lt;br /&gt;
    void requestQuota(&lt;br /&gt;
        unsigned short storageType, &lt;br /&gt;
        unsigned long long newQuotaInBytes, &lt;br /&gt;
        optional StorageInfoQuotaCallback successCallback, &lt;br /&gt;
        optional StorageInfoErrorCallback errorCallback); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoUsageCallback { &lt;br /&gt;
    void handleEvent(unsigned long long currentUsageInBytes, &lt;br /&gt;
                               unsigned long long currentQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
  &lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoQuotaCallback { &lt;br /&gt;
    void handleEvent(unsigned long long grantedQuotaInBytes); &lt;br /&gt;
  }; &lt;br /&gt;
&lt;br /&gt;
  [NoInterfaceObject, Callback=FunctionOnly] &lt;br /&gt;
  interface StorageInfoErrorCallback { &lt;br /&gt;
    void handleEvent(DOMCoreException error); &lt;br /&gt;
  }; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes about TEMPORARY / PERSISTENT storageType const values: in general using string would be more preferable than enum, but for now we&#039;re proposing short const values to make it match with the type parameters of [http://www.w3.org/TR/file-system-api/ File API: Directories and System].&lt;br /&gt;
&lt;br /&gt;
=== Example Code ===&lt;br /&gt;
&lt;br /&gt;
The app can get the current quota and usage for the apps&#039; origin by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.queryUsageAndQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,    // or TEMPORARY&lt;br /&gt;
    function (usage, quota) { log(&amp;quot;Current usage/quota:&amp;quot; + usage + &amp;quot;/&amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Querying quota got error: &amp;quot; + error); });&lt;br /&gt;
&lt;br /&gt;
The app can also request more quota by calling:&lt;br /&gt;
&lt;br /&gt;
  storageInfo.requestQuota(&lt;br /&gt;
    storageInfo.PERSISTENT,&lt;br /&gt;
    requestingQuota,&lt;br /&gt;
    function (quota) { log(&amp;quot;Requested &amp;quot; + requestingQuota + &amp;quot; =&amp;gt; got &amp;quot; + quota); },&lt;br /&gt;
    function (error) { log(&amp;quot;Requesting quota got error: &amp;quot; + error); });&lt;/div&gt;</summary>
		<author><name>Kinuko</name></author>
	</entry>
</feed>