UploadGateway (cloud-services/uploadgateway)
@ckeditor/ckeditor5-cloud-services/src/uploadgateway/uploadgateway
class
UploadGateway abstracts file uploads to CKEditor Cloud Services.
Filtering
Properties
-
_apiAddress : String
module:cloud-services/uploadgateway/uploadgateway~UploadGateway#_apiAddress
private
CKEditor Cloud Services API address.
-
CKEditor Cloud Services access token.
Methods
-
constructor( token, apiAddress )
module:cloud-services/uploadgateway/uploadgateway~UploadGateway#constructor
Creates
UploadGateway
instance.Parameters
token : Token
Token used for authentication.
apiAddress : String
API address.
-
upload( fileOrData ) → FileUploader
module:cloud-services/uploadgateway/uploadgateway~UploadGateway#upload
Creates a
FileUploader
instance that wraps file upload process. The file is being sent at a time when thesend
method is called.const token = await Token.create( 'https://token-endpoint' ); new UploadGateway( token, 'https://example.org' ) .upload( 'FILE' ) .onProgress( ( data ) => console.log( data ) ) .send() .then( ( response ) => console.log( response ) );
Parameters
fileOrData : Blob | String
A blob object or a data string encoded with Base64.
Returns
FileUploader
Returns
FileUploader
instance.
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.