s3ClearBucket

Deletes every object in an S3 bucket, leaving the bucket in place. With maxage, only objects older than that are deleted.

s3ClearBucket(bucketName [, maxage, accessKeyId, secretAccessKey, host, timeout]) → returns void

Argument Reference

bucketName string
Required

The bucket name.

maxage numeric

Only delete objects older than this timespan.

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 first argument bucket and the secret key argument secretKey. Doesn't list maxage or timeout.

Examples
Sample code invoking the s3ClearBucket function

Removes all objects from the bucket.

s3ClearBucket("my-bucket");

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

Fork me on GitHub