UploadGateway
class
UploadGateway abstracts file uploads to CKEditor Cloud Services.
Properties
-
_apiAddress : string
privatereadonlymodule:cloud-services/uploadgateway/uploadgateway~UploadGateway#_apiAddress
CKEditor Cloud Services API address.
-
_token : InitializedToken
privatereadonlymodule:cloud-services/uploadgateway/uploadgateway~UploadGateway#_token
CKEditor Cloud Services access token.
Methods
-
constructor( token, apiAddress )
module:cloud-services/uploadgateway/uploadgateway~UploadGateway#constructor
Creates
UploadGateway
instance.Parameters
token : InitializedToken
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 : string | Blob
A blob object or a data string encoded with Base64.
Returns
FileUploader
Returns
FileUploader
instance.