HTML and CSS Reference
In-Depth Information
3.3. Managing files locally: the File System, Quota Management, File, - and
File Writer APIs
Working with files in web applications has always been tricky. If you wanted to save a file,
you'd select it using a file <input> element, then the browser would upload the file to
the server for storage. Downloading a previously stored file was a similarly slow and cum-
bersome process. In addition, you were burdened with the tedious task of developing yet
another file management system using one set of tools and languages on the server and an-
other on the browser side. Suffice it to say, files and web applications have always been a
bit of a bitter cocktail. Thankfully, HTML5 is going to greatly speed up this development
process with the File System API.
File System API
In this section, you'll learn
• How to create a sandboxed filesystem using the File System API
• How to use the Quota Management API to allocate local storage space
• How to create filesystem services using the File Writer and File APIs
The File System API offers web applications access to a sandboxed storage space on the
client's local filesystem. For security purposes, applications can only access the files in
their own sandbox on the client, preventing malicious apps from accessing and manipulat-
ing data stored by other applications. The File System API also offers applications a choice
between a temporary or persistent filesystem. Data in a temporary filesystem can be re-
moved at any stage by the browser, and the data's continued existence shouldn't be relied
on, whereas data in a persistent filesystem can only be removed if specifically requested
by the user. Because we want the Super HTML5 Editor to save a user's work for later use,
we'll show you how to build a persistent filesystem.
Search WWH ::

Custom Search