The FileReader
object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File
or Blob
objects to specify the file or data to read. File objects may be obtained in one of two ways: from a FileList
object returned as a result of a user selecting files using the <input>
element, or from a drag and drop operation's DataTransfer
object.
To create a FileReader
, simply do the following:
var reader = new FileReader();
See Using files from web applications for details and examples.
onload
or onerror
.FileReader
. This will be one of the State constants. Read only.