IBM Aspera JavaScript Library
    Preparing search index...

    Function hasCapability

    • Check if the SDK and underlying transfer client supports a specific capability or feature.

      Capabilities depend on the transfer client being used (HTTP Gateway, Connect, or IBM Aspera for desktop).

      This function may be useful if you want to conditionally perform certain actions rather than potentially getting an error.

      For example, only IBM Aspera for desktop supports traversing a folder's contents. An application can check hasCapability('readDirectory') to optionally show a folder browser only when the feature is available. For example, when a user does not have IBM Aspera for desktop installed and is using HTTP Gateway, your application can disable this feature. Later, if that same user installs IBM Aspera for desktop, your application will show the feature as enabled without any additional changes.

      Parameters

      Returns boolean

      true if the capability is supported, false otherwise

      // Determine if your web application can render image previews for user selected files
      if (asperaSdk.hasCapability('imagePreview')) {
      const response = await asperaSdk.readAsArrayBuffer(path);
      }