The DownloadDataInput object.
A cancelable task exposing result promise from result
property.
service: S3Exception - thrown when checking for existence of the object
validation: StorageValidationErrorCode - Validation errors
// Download a file from s3 bucket
const { body, eTag } = await downloadData({ key, data: file, options: {
onProgress, // Optional progress callback.
} }).result;
// Cancel a task
const downloadTask = downloadData({ key, data: file });
//...
downloadTask.cancel();
try {
await downloadTask.result;
} catch (error) {
if(isCancelError(error)) {
// Handle error thrown by task cancelation.
}
}
Download S3 object data to memory