This specification provides an API for representing file objects in web applications,
as well as programmatically selecting them and accessing their data. This includes:
A FileList interface, which represents an array of individually selected files from the underlying system. The user interface for selection can be invoked via <input type="file">, i.e. when the input element is in the File Upload state [HTML].
A Blob interface, which represents immutable raw binary data, and allows access to ranges of bytes within the Blob object as a separate Blob.
A File interface, which includes readonly informational attributes about a file such as its name and the date of the last modification (on disk) of the file.
A FileReader interface, which provides methods to read a File or a Blob, and an event model to obtain the results of these reads.
A URL scheme for use with binary data such as files, so that they can be referenced within web applications.
Additionally, this specification defines objects to be used within threaded web applications for the synchronous reading of files.
This API is designed to be used in conjunction with other APIs and elements on the web platform, notably:
XMLHttpRequest (e.g. with an overloaded send() method for File or Blob arguments),
postMessage(),
DataTransfer (part of the drag and drop API defined in [HTML])
and Web Workers.
Additionally, it should be possible to programmatically obtain a list of files from the input element
when it is in the File Upload state [HTML].
These kinds of behaviors are defined in the appropriate affiliated specifications.
Publication as an Editor’s Draft does not imply endorsement by W3C and its Members.
This is a draft document
and may be updated, replaced
or obsoleted by other documents at any time.
It is inappropriate to cite this document as other than a work in progress.
This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent that the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
Web applications should have the ability to manipulate as wide as possible a range of user input,
including files that a user may wish to upload to a remote server or manipulate inside a rich web application.
This specification defines the basic representations for files,
lists of files,
errors raised by access to files,
and programmatic ways to read files.
Additionally, this specification also defines an interface that represents "raw data"
which can be asynchronously processed on the main thread of conforming user agents.
The interfaces and API defined in this specification can be used with other interfaces and APIs exposed to the web platform.
The File interface represents file data typically obtained from the underlying file system,
and the Blob interface
("Binary Large Object" - a name originally introduced to web APIs in Google Gears)
represents immutable raw data.
File or Blob reads should happen asynchronously on the main thread,
with an optional synchronous API used within threaded web applications.
An asynchronous API for reading files prevents blocking and UI "freezing" on a user agent’s main thread.
This specification defines an asynchronous API based on an event model
to read and access a File or