• Download S3 object data to memory

    Parameters

    Returns DownloadDataWithPathOutput

    A cancelable task exposing result promise from result property.

    Throws

    service: S3Exception - thrown when checking for existence of the object

    Throws

    validation: StorageValidationErrorCode - Validation errors

    Example

    // Download a file from s3 bucket
    const { body, eTag } = await downloadData({ path, options: {
    onProgress, // Optional progress callback.
    } }).result;

    Example

    // Cancel a task
    const downloadTask = downloadData({ path });
    //...
    downloadTask.cancel();
    try {
    await downloadTask.result;
    } catch (error) {
    if(isCancelError(error)) {
    // Handle error thrown by task cancelation.
    }
    }
  • Parameters

    Returns DownloadDataOutput

    A cancelable task exposing result promise from result property.

    Deprecated

    The key and accessLevel parameters are deprecated and may be removed in the next major version. Please use path instead.

    Download S3 object data to memory

    Throws

    service: S3Exception - thrown when checking for existence of the object

    Throws

    validation: StorageValidationErrorCode - Validation errors

    Example

    // Download a file from s3 bucket
    const { body, eTag } = await downloadData({ key, options: {
    onProgress, // Optional progress callback.
    } }).result;

    Example

    // Cancel a task
    const downloadTask = downloadData({ key });
    //...
    downloadTask.cancel();
    try {
    await downloadTask.result;
    } catch (error) {
    if(isCancelError(error)) {
    // Handle error thrown by task cancelation.
    }
    }