UploadGateway
class
UploadGateway abstracts file uploads to CKEditor Cloud Services.
Properties
-
_apiAddress : stringprivatereadonlymodule:cloud-services/uploadgateway/uploadgateway~UploadGateway#_apiAddressCKEditor Cloud Services API address.
-
_token : InitializedTokenprivatereadonlymodule:cloud-services/uploadgateway/uploadgateway~UploadGateway#_tokenCKEditor Cloud Services access token.
Methods
-
constructor( token, apiAddress )module:cloud-services/uploadgateway/uploadgateway~UploadGateway#constructorCreates
UploadGatewayinstance.Parameters
token : InitializedTokenToken used for authentication.
apiAddress : stringAPI address.
-
upload( fileOrData ) → FileUploadermodule:cloud-services/uploadgateway/uploadgateway~UploadGateway#uploadCreates a
FileUploaderinstance that wraps file upload process. The file is being sent at a time when thesendmethod 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 ) );Copy codeParameters
fileOrData : string | BlobA blob object or a data string encoded with Base64.
Returns
FileUploaderReturns
FileUploaderinstance.