s3Move

Moves an object to another bucket or key, by copying it and then deleting the source.

s3Move(srcBucketName, srcObjectName, trgBucketName [, trgObjectName, acl, location, accessKeyId, secretAccessKey, host, timeout]) → returns void

Argument Reference

srcBucketName string
Required

The source bucket.

srcObjectName string
Required

The source object key.

trgBucketName string
Required

The target bucket.

trgObjectName string

The target object key. Defaults to the source object key.

acl any

An array of structs, one for each ACL grant.

location string

The S3 region.

accessKeyId string

The S3 access key ID. Defaults to the lucee.s3.accesskeyid system property or environment variable.

secretAccessKey string

The S3 secret access key. Defaults to the lucee.s3.secretaccesskey system property or environment variable.

host string

The hostname of an S3-compatible provider, without https://. Defaults to Amazon AWS.

timeout numeric
Default: 10000

The timeout in milliseconds.

Compatibility

Lucee:

Requires the S3 extension.

RustCFML:

Names the bucket and object arguments srcBucket, srcObject, trgBucket and trgObject, and the secret key argument secretKey. Doesn't list location or timeout, so accessKeyId is the sixth argument.

Examples
Sample code invoking the s3Move function

Copies the object to the target and deletes the source.

s3Move("src-bucket", "reports/q3.pdf", "archive-bucket");

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub