FileReader : EventTarget
FileReader is used to read the contents of a %%/Blob|**Blob**%% or
%%/File|**File**%%.
Spec:
http://www.w3.org/TR/FileAPI/#FileReader-interface
----
new FileReader() : FileReader
Constructs a new FileReader.
Spec:
http://www.w3.org/TR/FileAPI/#dfn-filereader
----
prototype.readAsArrayBuffer(blob : Blob) : undefined
Begins reading from **blob** as an %%/ArrayBuffer|**ArrayBuffer**%%.
The result will
be stored on %%#result|**this.result**%% after the %%#onload|**'load'**%% event
fires.
See also %%/Blob#arrayBuffer|Blob.arrayBuffer()%%.
Spec:
http://www.w3.org/TR/FileAPI/#readAsArrayBuffer
----
prototype.readAsText(blob : Blob, [encoding : String]) : undefined
Begins reading from **blob** as a string. The result will
be stored on %%#result|**this.result**%% after the %%#onload|**'load'**%% event fires.
For the valid values of **encoding**, see %%http://www.iana.org/assignments/character-sets/character-sets.xhtml|character
sets%%.
See also %%/Blob#text|Blob.text()%%.
Spec:
http://www.w3.org/TR/FileAPI/#readAsDataText
----
prototype.readAsDataURL(blob : Blob) : undefined
Begins reading from **blob** as a **'data:'** url string. The result will
be stored on %%#result|**this.result**%% after the %%#onload|**'load'**%%
event fires.
Spec:
http://www.w3.org/TR/FileAPI/#readAsDataURL
----
prototype.abort() : undefined
Stops the current read operation.
Spec:
http://www.w3.org/TR/FileAPI/#abort
----
instance.readyState : Number
The current state of the reader. Will be one of %%#EMPTY|**EMPTY**%%,
%%#LOADING|**LOADING**%%, or %%#DONE|**DONE**%%.
ReadOnly:
true
----
instance.result : Object
The result from the previous read. The result will be either a
%%/String|**String**%% or an %%/ArrayBuffer|**ArrayBuffer**%%.
The result is only available after the %%#onload|**load**%% event
fires.
ReadOnly:
true
Spec:
http://www.w3.org/TR/FileAPI/#dfn-result
----
instance.error : Error
The error encountered during load.
ReadOnly:
true
Spec:
http://www.w3.org/TR/FileAPI/#dfn-error
----
event.loadstart : listener(event : ProgressEvent) : undefined
Called after starting a read operation.
----
event.progress : listener(event : ProgressEvent) : undefined
Called during a read operation to report the current progress.
----
event.load : listener(event : ProgressEvent) : undefined
Called when a read operation successfully completes.
----
event.abort : listener(event : ProgressEvent) : undefined
Called when the read is aborted with %%#abort|**abort()**%%.
----
event.error : listener(event : ProgressEvent) : undefined
Called when there is an error during the load.
----
event.loadend : listener(event : ProgressEvent) : undefined
Called after a read completes (either successfully or
unsuccessfully).
----
EMPTY : Number
The value returned by %%#readyState|**readyState**%% before the
one of the read methods has been called.
ReadOnly:
true
Value:
0
----
LOADING : Number
The value returned by %%#readyState|**readyState**%% after
one of the read methods has been called but before the %%#onload|**load**%%
event has fired.
ReadOnly:
true
Value:
1
----
DONE : Number
The value returned by %%#readyState|**readyState**%% after
the %%#onload|**load**%% event has fired.
ReadOnly:
true
Value:
2