API Reference
copy
Copy an object from a source to a destination object within the same bucket.
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The CopyWithPathInput object. |
Throws
service:
S3Exception
- Thrown when checking for existence of the objectvalidation:
StorageValidationErrorCode
- Thrown when source or destination path is not defined.
copy
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The CopyInput object. |
Throws
service:
S3Exception
- Thrown when checking for existence of the objectvalidation:
StorageValidationErrorCode
- Thrown when source or destination key is not defined.
downloadData
Download S3 object data to memory
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The DownloadDataWithPathInput object. |
Throws
service:
S3Exception
- thrown when checking for existence of the objectvalidation:
StorageValidationErrorCode
- Validation errors
downloadData
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The DownloadDataInput object. |
Throws
service:
S3Exception
- thrown when checking for existence of the objectvalidation:
StorageValidationErrorCode
- Validation errors
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
Option | Required | Type | Description |
---|---|---|---|
input | true | The GetPropertiesWithPathInput object. |
Throws
An
S3Exception
when the underlying S3 service returned error.A
StorageValidationErrorCode
when API call parameters are invalid.
getProperties
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The GetPropertiesInput object. |
Throws
An
S3Exception
when the underlying S3 service returned error.A
StorageValidationErrorCode
when API call parameters are invalid.
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
Option | Required | Type | Description |
---|---|---|---|
input | true | The GetUrlWithPathInput object. |
Throws
service:
S3Exception
- thrown when checking for existence of the objectvalidation:
StorageValidationErrorCode
- Validation errors thrown either username or key are not defined.
getUrl
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The GetUrlInput object. |
Throws
service:
S3Exception
- thrown when checking for existence of the objectvalidation:
StorageValidationErrorCode
- Validation errors thrown either username or key are not defined.
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
Option | Required | Type | Description |
---|---|---|---|
error | true | unknown | 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
Option | Required | Type | Description |
---|---|---|---|
input | true | The ListPaginateWithPathInput object. |
Throws
service:
S3Exception
- S3 service errors thrown when checking for existence of bucketvalidation:
StorageValidationErrorCode
- thrown when there are issues with credentials
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
Option | Required | Type | Description |
---|---|---|---|
input | true | The ListAllWithPathInput object. |
Throws
service:
S3Exception
- S3 service errors thrown when checking for existence of bucketvalidation:
StorageValidationErrorCode
- thrown when there are issues with credentials
list
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | false | The ListPaginateInput object. |
Throws
service:
S3Exception
- S3 service errors thrown when checking for existence of bucketvalidation:
StorageValidationErrorCode
- thrown when there are issues with credentials
Returns
Promise<>
list
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | false | The ListAllInput object. |
Throws
service:
S3Exception
- S3 service errors thrown when checking for existence of bucketvalidation:
StorageValidationErrorCode
- thrown when there are issues with credentials
Returns
Promise<>
remove
Remove a file from your S3 bucket.
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | 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.
remove
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The RemoveInput object. |
Throws
service:
S3Exception
- S3 service errors thrown while while removing the objectvalidation:
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
Option | Required | Type | Description |
---|---|---|---|
input | true | A UploadDataWithPathInput object. |
Throws
Service:
S3Exception
thrown when checking for existence of the object.Validation:
StorageValidationErrorCode
thrown when a validation error occurs.
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
Option | Required | Type | Description |
---|---|---|---|
input | true | A UploadDataInput object. |
Throws
Service:
S3Exception
thrown when checking for existence of the object.Validation:
StorageValidationErrorCode
thrown when a validation error occurs.
Link Color Legend
Interface
Reference
Other