FileReader

The FileReader interface 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 Reference

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed interface ReadyState

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The error read-only property of the FileReader interface returns the error that occurred while reading the file.

Link copied to clipboard
Link copied to clipboard

The readyState read-only property of the FileReader interface provides the current state of the reading operation.

Link copied to clipboard

The result read-only property of the FileReader interface returns the file's contents.

Functions

Link copied to clipboard
fun abort()

The abort() method of the FileReader interface aborts the read operation.

Link copied to clipboard
Link copied to clipboard

The readAsArrayBuffer() method of the FileReader interface is used to start reading the contents of a specified Blob or File.

Link copied to clipboard
fun readAsDataURL(blob: Blob)

The readAsDataURL() method of the FileReader interface is used to read the contents of the specified file's data as a base64 encoded string.

Link copied to clipboard
fun readAsText(blob: Blob, encoding: String = definedExternally)

The readAsText() method of the FileReader interface is used to read the contents of the specified Blob or File.

Link copied to clipboard
fun <T : Event> when(type: EventType<T>, options: ObservableEventListenerOptions? = definedExternally): Observable<T>