The spec provides several interfaces for accessing files from a 'local' filesystem:
File
- an individual file; provides readonly information such as name, file size, mimetype, and a reference to the file handle.FileList
- an array-like sequence ofFile
objects. (Think<input type="file" multiple>
or dragging a directory of files from the desktop).Blob
- Allows for slicing a file into byte ranges.
FileReader
interface
can be used to asynchronously read a file through familiar JavaScript
event handling. Thus, it is possible to monitor the progress of a read,
catch errors,
and determine when a load is complete. In many ways the APIs resemble XMLHttpRequest
's event model.Note: At the time of writing this tutorial, the necessary APIs for working with local files are supported in Chrome 6.0 and Firefox 3.6. As of Firefox 3.6.3, the
File.slice()
method is not supported.http://www.html5rocks.com/en/tutorials/file/dndfiles/
No comments:
Post a Comment