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.
Documentation for this class was provided by MDN. var error(default,null) : FileErrorThe error that occurred while reading the file. Read only. var onabort : EventListenerCalled when the read operation is aborted. var onerror : EventListenerCalled when an error occurs. var onload : EventListenerCalled when the read operation is successfully completed. var onloadend : EventListenerCalled when the read is completed, whether successful or not. This is called after either onload or onerror. var onloadstart : EventListenerCalled when reading the data is about to begin. var onprogress : EventListenerCalled periodically while the data is being read. var readyState(default,null) : IntIndicates the state of the FileReader. This will be one of the State constants. Read only. var result(default,null) : DynamicThe file's contents. This property is only valid after the read operation is complete, and the format of the data depends on which of the methods was used to initiate the read operation. Read only. function new() : Void function abort() : Void function readAsArrayBuffer( blob : Blob ) : Void function readAsBinaryString( blob : Blob ) : Void function readAsDataURL( blob : Blob ) : Void function readAsText( blob : Blob, ?encoding : String ) : Void static inline var DONE : IntThe entire read request has been completed. static inline var EMPTY : IntNo data has been loaded yet. static inline var LOADING : IntData is currently being loaded.