Class

UploadGateway (cloud-services/uploadgateway)

@ckeditor/ckeditor5-cloud-services/src/uploadgateway/uploadgateway

class

UploadGateway abstracts file uploads to CKEditor Cloud Services.

Filtering

Properties

  • _apiAddress : String

    private

    CKEditor Cloud Services API address.

  • _token : Token

    private

    CKEditor Cloud Services access token.

Methods

  • constructor( token, apiAddress )

    Creates UploadGateway instance.

    Parameters

    token : Token

    Token used for authentication.

    apiAddress : String

    API address.

  • upload( fileOrData ) → FileUploader

    Creates a FileUploader instance that wraps file upload process. The file is being sent at a time when the send 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.