Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Choose your framework/language

API Reference

copy

Copy an object from a source to a destination object within the same bucket.

Parameters

OptionRequiredTypeDescription
inputtrue
The CopyWithPathInput object.

Throws

  • service:S3Exception - Thrown when checking for existence of the object
  • validation:StorageValidationErrorCode - Thrown when source or destination path is not defined.

Returns

Promise<>
Output type with path for S3 copy API.

copy

Parameters

OptionRequiredTypeDescription
inputtrue
The CopyInput object.

Throws

  • service:S3Exception - Thrown when checking for existence of the object
  • validation:StorageValidationErrorCode - Thrown when source or destination key is not defined.

Returns

Promise<>
Output type with path for S3 copy API.

downloadData

Download S3 object data to memory

Parameters

OptionRequiredTypeDescription
inputtrue
The DownloadDataWithPathInput object.

Throws

  • service:S3Exception - thrown when checking for existence of the object
  • validation:StorageValidationErrorCode - Validation errors

Returns

Output type with path for S3 downloadData API.

downloadData

Parameters

OptionRequiredTypeDescription
inputtrue
The DownloadDataInput object.

Throws

  • service:S3Exception - thrown when checking for existence of the object
  • validation:StorageValidationErrorCode - Validation errors

Returns

Output type for S3 downloadData API.

getProperties

Gets the properties of a file. The properties include S3 system metadata and the user metadata that was provided when uploading the file.

Parameters

OptionRequiredTypeDescription
inputtrue
The GetPropertiesWithPathInput object.

Throws

  • AnS3Exception when the underlying S3 service returned error.
  • AStorageValidationErrorCode when API call parameters are invalid.

Returns

Promise<>
Output type with path for S3 getProperties API.

getProperties

Parameters

OptionRequiredTypeDescription
inputtrue
The GetPropertiesInput object.

Throws

  • AnS3Exception when the underlying S3 service returned error.
  • AStorageValidationErrorCode when API call parameters are invalid.

Returns

Promise<>
Output type for S3 getProperties API.

getUrl

Get a temporary presigned URL to download the specified S3 object. The presigned URL expires when the associated role used to sign the request expires or the option expiresIn is reached. The expiresAt
property in the output object indicates when the URL MAY expire.
By default, it will not validate the object that exists in S3. If you set the options.validateObjectExistence to true, this method will verify the given object already exists in S3 before returning a presigned URL, and will throw StorageError if the object does not exist.

Parameters

OptionRequiredTypeDescription
inputtrue
The GetUrlWithPathInput object.

Throws

  • service:S3Exception - thrown when checking for existence of the object
  • validation:StorageValidationErrorCode - Validation errors thrown either username or key are not defined.

Returns

Promise<>
Output type with path for S3 getUrl API.

getUrl

Parameters

OptionRequiredTypeDescription
inputtrue
The GetUrlInput object.

Throws

  • service:S3Exception - thrown when checking for existence of the object
  • validation:StorageValidationErrorCode - Validation errors thrown either username or key are not defined.

Returns

Promise<>
Output type for S3 getUrl API.

isCancelError

Check if an error is caused by user calling cancel() on a upload/download task. If an overwriting error is supplied to task.cancel(errorOverwrite), this function will return false.

Parameters

OptionRequiredTypeDescription
errortrueunknown
The unknown exception to be checked.

Returns

CanceledError

list

List files in pages with the given path. pageSize is defaulted to 1000. Additionally, the result will include a nextToken if there are more items to retrieve.

Parameters

OptionRequiredTypeDescription
inputtrue
The ListPaginateWithPathInput object.

Throws

  • service:S3Exception - S3 service errors thrown when checking for existence of bucket
  • validation:StorageValidationErrorCode - thrown when there are issues with credentials

Returns

Promise<>
Output type with path for S3 list API. Lists bucket objects with pagination.

list

List all files from S3 for a given path. You can set listAll to true in options to get all the files from S3.

Parameters

OptionRequiredTypeDescription
inputtrue
The ListAllWithPathInput object.

Throws

  • service:S3Exception - S3 service errors thrown when checking for existence of bucket
  • validation:StorageValidationErrorCode - thrown when there are issues with credentials

Returns

Promise<>
Output type with path for S3 list API. Lists all bucket objects.

list

Parameters

OptionRequiredTypeDescription
inputfalse
The ListPaginateInput object.

Throws

  • service:S3Exception - S3 service errors thrown when checking for existence of bucket
  • validation:StorageValidationErrorCode - thrown when there are issues with credentials

Returns

Promise<>

list

Parameters

OptionRequiredTypeDescription
inputfalse
The ListAllInput object.

Throws

  • service:S3Exception - S3 service errors thrown when checking for existence of bucket
  • validation:StorageValidationErrorCode - thrown when there are issues with credentials

Returns

Promise<>

remove

Remove a file from your S3 bucket.

Parameters

OptionRequiredTypeDescription
inputtrue
The RemoveWithPathInput object.

Throws

  • service:S3Exception - S3 service errors thrown while while removing the object.
  • validation:StorageValidationErrorCode - Validation errors thrown when there is no path or path is empty or path has a leading slash.

Returns

Promise<>
Output type with path for S3 remove API.

remove

Parameters

OptionRequiredTypeDescription
inputtrue
The RemoveInput object.

Throws

  • service:S3Exception - S3 service errors thrown while while removing the object
  • validation:StorageValidationErrorCode - Validation errors thrown when there is no key or its empty.

Returns

Promise<>

uploadData

Upload data to the specified S3 object path. By default uses single PUT operation to upload if the payload is less than 5MB. Otherwise, uses multipart upload to upload the payload. If the payload length cannot be determined, uses multipart upload.
Limitations: * Maximum object size is 5TB. * Maximum object size if the size cannot be determined before upload is 50GB.

Parameters

OptionRequiredTypeDescription
inputtrue
A UploadDataWithPathInput object.

Throws

  • Service:S3Exception thrown when checking for existence of the object.
  • Validation:StorageValidationErrorCode thrown when a validation error occurs.

Returns

Output type with path for S3 uploadData API.

uploadData

Upload data to the specified S3 object key. By default uses single PUT operation to upload if the payload is less than 5MB. Otherwise, uses multipart upload to upload the payload. If the payload length cannot be determined, uses multipart upload.
Limitations: * Maximum object size is 5TB. * Maximum object size if the size cannot be determined before upload is 50GB.

Parameters

OptionRequiredTypeDescription
inputtrue
A UploadDataInput object.

Throws

  • Service:S3Exception thrown when checking for existence of the object.
  • Validation:StorageValidationErrorCode thrown when a validation error occurs.

Returns

Output type for S3 uploadData API.

Link Color Legend

Interface
Reference
Other