FileReader (upload)
@ckeditor/ckeditor5-upload/src/filereader
Wrapper over the native FileReader
.
Filtering
Properties
-
Returns error that occurred during file reading.
-
loaded : Number
readonly observable
Number of bytes loaded.
-
_reader : FileReader
private
Instance of native FileReader.
Methods
-
Creates an instance of the FileReader.
-
abort()
Aborts file reader.
-
read( file ) → Promise
Reads the provided file.
Parameters
file : File
Native File object.
Returns
Promise
Returns a promise that will be resolved with file's content. The promise will be rejected in case of an error or when the reading process is aborted.
Events
-
change:loaded( eventInfo, name, value, oldValue )
Fired when the
loaded
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : String
Name of the changed property (
loaded
).value : Number
New value of the
loaded
property with given key ornull
, if operation should remove property.oldValue : Number
Old value of the
loaded
property with given key ornull
, if property was not set before.