class FileReader extends EventTarget
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.
MDN
- Annotations
- @JSType() @native() @JSGlobal()
- Alphabetic
- By Inheritance
- FileReader
- EventTarget
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new FileReader()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
abort(): Unit
Aborts the read operation.
Aborts the read operation. Upon return, the readyState will be DONE.
MDN
-
def
addEventListener[T <: Event](type: String, listener: Function1[T, _], options: EventListenerOptions): Unit
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).
This implementation accepts a settings object of type EventListenerOptions.
MDN
- Definition Classes
- EventTarget
-
def
addEventListener[T <: Event](type: String, listener: Function1[T, _], useCapture: Boolean = js.native): Unit
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on.
The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).
MDN
- Definition Classes
- EventTarget
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
dispatchEvent(evt: Event): Boolean
Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order.
Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().
MDN
- Definition Classes
- EventTarget
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
error: DOMException
A DOMException representing the error that occurred while reading the file.
A DOMException representing the error that occurred while reading the file.
MDN
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
var
onabort: Function1[Event, _]
A handler for the abort event.
A handler for the abort event. This event is triggered each time the reading operation is aborted.
MDN
-
var
onerror: Function1[Event, _]
A handler for the error event.
A handler for the error event. This event is triggered each time the reading operation encounter an error.
MDN
-
var
onload: Function1[UIEvent, _]
A handler for the load event.
A handler for the load event. This event is triggered each time the reading operation is successfully completed.
MDN
-
var
onloadend: Function1[ProgressEvent, _]
A handler for the loadend event.
A handler for the loadend event. This event is triggered each time the reading operation is completed (either in success or failure).
MDN
-
var
onloadstart: Function1[ProgressEvent, _]
A handler for the loadstart event.
A handler for the loadstart event. This event is triggered each time the reading is starting.
MDN
-
var
onprogress: Function1[ProgressEvent, _]
A handler for the progress event.
A handler for the progress event. This event is triggered while reading a Blob content.
MDN
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
readAsArrayBuffer(blob: Blob): Unit
The readAsArrayBuffer method is used to starts reading the contents of the specified Blob or File.
The readAsArrayBuffer method is used to starts reading the contents of the specified Blob or File. When the read operation is finished, the readyState becomes DONE, and the loadend is triggered. At that time, the result attribute contains an ArrayBuffer representing the file's data.
MDN
-
def
readAsDataURL(blob: Blob): Unit
The readAsDataURL method is used to starts reading the contents of the specified Blob or File.
The readAsDataURL method is used to starts reading the contents of the specified Blob or File. When the read operation is finished, the readyState becomes DONE, and the loadend is triggered. At that time, the result attribute contains a data: URL representing the file's data as base64 encoded string.
MDN
-
def
readAsText(blob: Blob, encoding: String = "UTF-8"): Unit
The readAsText method is used to read the contents of the specified Blob or File.
The readAsText method is used to read the contents of the specified Blob or File. When the read operation is complete, the readyState is changed to DONE, the loadend is triggered, and the result attribute contains the contents of the file as a text string.
MDN
-
def
readyState: Short
A number indicating the state of the FileReader.
A number indicating the state of the FileReader. This will be one of the State constants. EMPTY : 0 : No data has been loaded yet. LOADING : 1 : Data is currently being loaded. DONE : 2 : The entire read request has been completed.
MDN
-
def
removeEventListener[T <: Event](type: String, listener: Function1[T, _], options: EventListenerOptions): Unit
Removes the event listener previously registered with EventTarget.addEventListener.
Removes the event listener previously registered with EventTarget.addEventListener.
This implementation accepts a settings object of type EventListenerOptions.
MDN
- Definition Classes
- EventTarget
-
def
removeEventListener[T <: Event](type: String, listener: Function1[T, _], useCapture: Boolean = js.native): Unit
Removes the event listener previously registered with EventTarget.addEventListener.
Removes the event listener previously registered with EventTarget.addEventListener.
MDN
- Definition Classes
- EventTarget
-
def
result: Any
The file's contents.
The 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.
MDN
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()