Using the HTML5 Filesystem API

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Several client-side storage options are available to web applications, but one area that's been lacking until now is file I/O—the ability to organize binary data into a true hierarchy of folders. That has changed with the advent of HTML5. With this book, you'll learn how to provide your applications with a file system that enables them to create, read, and write files and folders in a sandboxed section of the user's local filesystem. Author Eric Bidelman, a Senior Developer Programs Engineer on the Google Chrome team, provides several techniques and complete code examples for working with the HTML5 Filesystem API.Learn common operations for working with files and directories Become familiar with HTML5's storage use cases and security considerations Understand the storage options available, including temporary, persistent, and unlimited Write text or append data to an existing user file Import files into your application by accessing a user's hard drive Get techniques for using a file with filesystem, blob, or data URLs Use the synchronous version of the HTML5 Filesystem API within a Web Worker context

Author(s): Eric Bidelman
Publisher: O'Reilly Media
Year: 2011

Language: English
Pages: 72
Tags: Библиотека;Компьютерная литература;HTML / CSS / JavaScript;HTML5 / CSS3;

Table of Contents......Page 7
Using Code Examples......Page 9
How to Contact Us......Page 10
Use Cases......Page 13
A Cautionary Tale......Page 15
Storage Types......Page 17
Persistent Storage......Page 18
Unlimited Storage......Page 19
Requesting More Storage......Page 20
Checking Current Usage......Page 21
Opening a Filesystem......Page 23
Handling Errors......Page 25
The FileEntry......Page 27
Creating a File......Page 28
Reading a File by Name......Page 29
Writing to a File......Page 30
Appending Data to a File......Page 31
Importing Files......Page 32
Using ......Page 33
Using HTML5 Drag and Drop......Page 34
Using XMLHttpRequest......Page 36
Using Copy and Paste......Page 39
Removing Files......Page 40
The DirectoryEntry......Page 43
Creating Directories......Page 44
Subdirectories......Page 45
Reading the Contents of a Directory......Page 46
Recursively Removing a Directory......Page 48
Copying a File or Directory......Page 49
Moving a File or Directory......Page 51
Renaming a File or Directory......Page 52
Filesystem URLs......Page 55
Blob URLs......Page 57
Data URLs......Page 61
Summary......Page 62
Opening a Filesystem......Page 65
Examples......Page 66
Fetching All Entries in the Filesystem......Page 67
Downloading Files Using XHR2......Page 68