FileUploader (cloud-services/uploadgateway)
@ckeditor/ckeditor5-cloud-services/src/uploadgateway/fileuploader
FileUploader class used to upload single file.
Filtering
Properties
-
file : Blob
module:cloud-services/uploadgateway/fileuploader~FileUploader#file
A file that is being uploaded.
-
_apiAddress : String
module:cloud-services/uploadgateway/fileuploader~FileUploader#_apiAddress
private
CKEditor Cloud Services API address.
-
CKEditor Cloud Services access token.
Methods
-
constructor( fileOrData, token, apiAddress )
module:cloud-services/uploadgateway/fileuploader~FileUploader#constructor
Creates
FileUploader
instance.Parameters
fileOrData : Blob | String
A blob object or a data string encoded with Base64.
token : Token
Token used for authentication.
apiAddress : String
API address.
-
abort()
module:cloud-services/uploadgateway/fileuploader~FileUploader#abort
Aborts upload process.
-
onError( callback ) → FileUploader
module:cloud-services/uploadgateway/fileuploader~FileUploader#onError
Registers callback on
error
event. Event is called once when error occurs. -
onProgress( callback ) → FileUploader
module:cloud-services/uploadgateway/fileuploader~FileUploader#onProgress
Registers callback on
progress
event. -
send() → Promise.<Object>
module:cloud-services/uploadgateway/fileuploader~FileUploader#send
Sends XHR request to API.
Returns
Promise.<Object>
-
_attachXHRListeners()
module:cloud-services/uploadgateway/fileuploader~FileUploader#_attachXHRListeners
private
Attaches listeners to the XHR.
-
_prepareRequest()
module:cloud-services/uploadgateway/fileuploader~FileUploader#_prepareRequest
private
Prepares XHR request.
-
_sendRequest()
module:cloud-services/uploadgateway/fileuploader~FileUploader#_sendRequest
private
Sends XHR request.
Events
-
error( eventInfo, error )
module:cloud-services/uploadgateway/fileuploader~FileUploader#event:error
Fired when error occurs.
Parameters
eventInfo : EventInfo
An object containing information about the fired event.
error : String
Error message
-
progress( eventInfo, status )
module:cloud-services/uploadgateway/fileuploader~FileUploader#event:progress
Fired on upload progress.
Parameters
eventInfo : EventInfo
An object containing information about the fired event.
status : Object
Total and uploaded status
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.