FileSystem

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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.

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
The definition of 'FileSystem' in that specification.
Draft

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
FileSystemChrome Full support 13
Prefixed
Full support 13
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support ≤18
Prefixed Notes
Full support ≤18
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 Full support 37
Prefixed
Full support 37
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android Full support 18
Prefixed
Full support 18
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 50Opera Android Full support 14
Prefixed
Full support 14
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari iOS No support NoSamsung Internet Android Full support 1.0
Prefixed
Full support 1.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit
nameChrome Full support 13Edge Full support ≤18Firefox Full support 50IE No support NoOpera Full support 15Safari No support NoWebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 50Opera Android Full support 14Safari iOS No support NoSamsung Internet Android Full support 1.0
rootChrome Full support 13Edge Full support ≤18Firefox Full support 50IE No support NoOpera Full support 15Safari No support NoWebView Android Full support 37Chrome Android Full support 18Firefox Android Full support 50Opera Android Full support 14Safari iOS No support NoSamsung Internet Android Full support 1.0

Legend

Full support  
Full support
No support  
No support
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