The File API enables web applications to access files and their contents.
Web applications can access files when the user makes them available, either using a file <input>
element or via drag and drop.
Sets of files made available in this way are represented as FileList
objects, which enable a web application to retrieve individual File
objects. In turn File
objects provide access to metadata such as the file's name, size, type, and last modified date.
File
objects can be passed to FileReader
objects to access the contents of the file. The FileReader
interface is asynchronous, but a synchronous version, available only in web workers, is provided by the FileReaderSync
interface.