Cumulocity Web SDK - v1023.0.0
    Preparing search index...

    Class InventoryBinaryService

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Uploads a file and creates a managed object with its metadata.

      Parameters

      • file: Stream | Blob | Buffer | File

        A file to be uploaded.

      • managedObject: Partial<IManagedObject> = {}

        An object containing metadata about the file. Note that you can specify fileType and fileName in case file does not define them but these two properties will be removed from managedObject before saving.

      Returns Promise<IResult<IManagedObjectBinary>>

    • Uploads a file and creates a managed object with its metadata. What's more, it invokes an upload progress callback.

      Parameters

      • file: Stream | Blob | Buffer | File

        A file to be uploaded.

      • onProgress: EventListener

        Event handler for progress update, invoked while the browser is uploading the file.

      • managedObject: Partial<IManagedObject> = {}

        An object containing metadata about the file.

      Returns XMLHttpRequest

    • Gets binary managed object's id from its download or self URL.

      Parameters

      • url: string

        URL string.

      Returns string

      Binary managed object's id.

      Example


      const id = InventoryBinaryService.getIdFromUrl('http://mytenant.cumulocity.com/inventory/binaries/12345');