Chapter 3. Getting Started
Opening a Filesystem
A web application obtains access to the HTML5 Filesystem by
using a global method,
window.requestFileSystem(type, size, successCallback, opt_errorCallback)
This method is currently vendor prefixed as
Its parameters are described below:
Whether the storage should be persistent. Possible values are
PERSISTENT. Data stored using
TEMPORARYcan be removed at the browser’s discretion (for example if more space is needed).
PERSISTENTstorage cannot cleared unless explicitly authorized by the user or the application.
An indicator of how much storage space, in bytes, the application expects to need.
A callback function that is called when the user agent successfully provides a filesystem. Its argument is a
An optional callback function which is called when an error occurs, or the request for a filesystem is denied. Its argument is a
window.requestFileSystem() for the first time
creates a new sandboxed storage space for the app and origin that
requested it. A filesystem is restricted to a single application and
cannot access another application’s stored data. This also means that an
application cannot read/write files to an arbitrary folder on the user’s
hard drive (such as My Pictures or My Documents). Each filesystem is