Skip to content

moxie.file.FileReader

Davit Barbakadze edited this page Aug 5, 2017 · 2 revisions

Important! This page is auto-generated from the comments in the source files. All changes will be overwritten! If you are looking to contribute, modify the comment in the corresponding source file instead.

Module: moxie.file.FileReader

Table of Contents

Constructor

Utility for preloading o.Blob/o.File objects in memory. By design closely follows W3C FileReader interface. Where possible uses native FileReader, where - not falls back to shims.

Properties

UID of the component instance.

Contains current state of FileReader object. Can take values of FileReader.EMPTY, FileReader.LOADING and FileReader.DONE.

Result of the successful read operation.

Stores the error of failed asynchronous read operation.

EMPTY static

Initial FileReader state

LOADING static

FileReader switches to this state when it is preloading the source

DONE static

Preloading is complete, this is a final state

Methods

Initiates reading of File/Blob object contents to binary string.

Arguments

  • blob Blob|File
    Object to preload

Initiates reading of File/Blob object contents to dataURL string.

Arguments

  • blob Blob|File
    Object to preload

Initiates reading of File/Blob object contents to string.

Arguments

  • blob Blob|File
    Object to preload

Aborts preloading process.

Destroy component and release resources.

Events

loadstart

Dispatched when the read starts.

Arguments

  • event Object

progress

Dispatched while reading (and decoding) blob, and reporting partial Blob data (progess.loaded/progress.total).

Arguments

  • event Object

load

Dispatched when the read has successfully completed.

Arguments

  • event Object

abort

Dispatched when the read has been aborted. For instance, by invoking the abort() method.

Arguments

  • event Object

error

Dispatched when the read has failed.

Arguments

  • event Object

loadend

Dispatched when the request has completed (either in success or failure).

Arguments

  • event Object