File and Directory Entries API
The File and Directory Entries API simulates a local file system that web apps can navigate within and access files in. You can develop apps which read, write, and create files and/or directories in a virtual, sandboxed file system.
Getting access to a file system
There are two ways to get access to file systems defined in the current specification draft:
- When handling a
dropevent for drag and drop, you can call
DataTransferItem.webkitGetAsEntry()to get the
FileSystemEntryfor a dropped item. If the result isn't
null, then it's a dropped file or directory, and you can use file system calls to work with it.
HTMLInputElement.webkitEntriesproperty lets you access the
FileSystemFileEntryobjects for the currently selected files, but only if they are dragged-and-dropped onto the file chooser (Firefox bug 1326031). If
<input>element is instead a directory picker, and you get
FileSystemDirectoryEntryobjects for each selected directory.
The File and Directory Entries API includes the following interfaces:
Represents a file system.
The basic interface representing a single entry in a file system. This is implemented by other interfaces which represent files or directories.
Represents a single file in a file system.
Represents a single directory in a file system.
Created by calling
FileSystemDirectoryEntry.createReader(), this interface provides the functionality which lets you read the contents of a directory.
|File and Directory Entries API |
BCD tables only load in the browser