Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The File and Directory Entries API interface FileSystem is used to represent a file system. These objects can be obtained from the filesystem property on any file system entry. Some browsers offer additional APIs to create and manage file systems, such as Chrome's requestFileSystem() method.

This interface will not grant you access to the users filesystem. Instead you will have a "virtual drive" within the browser sandbox. If you want to gain access to the users filesystem you need to invoke the user by eg. installing a Chrome extension. The relevant Chrome API can be found here.

Because this is a non-standard API, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it. Check the Browser compatibility section for details.

Basic concepts

There are two ways to get access to a FileSystem object:

  1. You can directly ask for one representing a sandboxed file system created just for your web app directly by calling window.requestFileSystem().  If that call is successful, it executes a callback handler, which receives as a parameter a FileSystem object describing the file system.
  2. You can get it from a file system entry object, through its filesystem property.

Properties

FileSystem.name Read only
A USVString representing the file system's name. This name is unique among the entire list of exposed file systems.
FileSystem.root Read only
A FileSystemDirectoryEntry object which represents the file system's root directory. Through this object, you can gain access to all files and directories in the file system.

Specifications

Specification Status Comment
File and Directory Entries API Draft Draft of proposed API

This API has no official W3C or WHATWG specification.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support
DeprecatedNon-standard
Chrome Full support 13
Prefixed
Full support 13
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support Yes
Prefixed Notes
Full support Yes
Prefixed Notes
Prefixed Implemented with the vendor prefix: WebKit
Notes Edge only supports this API in drag-and-drop scenarios using the the DataTransferItem.webkitGetAsEntry() method. It's not available for use in file or folder picker panels (such as when you use an <input> element with the HTMLInputElement.webkitdirectory attribute.
Firefox Full support 50IE No support NoOpera Full support 15
Prefixed
Full support 15
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari No support NoWebView Android ? Chrome Android ? Edge Mobile ? Firefox Android Full support 50Opera Android Full support 15
Prefixed
Full support 15
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari iOS No support NoSamsung Internet Android ?
name
DeprecatedNon-standard
Chrome Full support 13Edge Full support YesFirefox Full support 50IE No support NoOpera Full support 15Safari No support NoWebView Android ? Chrome Android ? Edge Mobile ? Firefox Android Full support 50Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?
root
DeprecatedNon-standard
Chrome Full support 13Edge Full support YesFirefox Full support 50IE No support NoOpera Full support 15Safari No support NoWebView Android ? Chrome Android ? Edge Mobile ? Firefox Android Full support 50Opera Android Full support 15Safari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also

Document Tags and Contributors

Last updated by: ExE-Boss,