Generates a presigned URL that gives temporary access to an S3 object.
s3GeneratePresignedURL(bucketNameOrPath [, objectName, expireDate, httpMethod, sseAlgorithm, sseCustomerKey, checksum, type, disposition, encoding, version, zeroByte, responseHeaders, accessKeyId, secretAccessKey, host, timeout])
→ returns string
s3:// path to a bucket or object, such as s3://mybucket/file.txt.
bucketNameOrPath is a bucket name.
GET or PUT.
AES256 or KMS.
attachment; filename="report.pdf".
gzip.
x-amz-meta- prefix is added when missing.
lucee.s3.accesskeyid system property or environment variable.
lucee.s3.secretaccesskey system property or environment variable.
https://. Defaults to Amazon AWS.
10000bucket and object, and the secret key argument secretKey. expireDate also accepts a number of minutes and defaults to 15 minutes. Only expireDate and httpMethod are supported of the URL arguments, so accessKeyId is the fifth argument.
Creates a URL that expires in 60 minutes.
url = s3GeneratePresignedURL("my-bucket", "reports/q3.pdf", dateAdd("n", 60, now()));
The fourth argument selects the HTTP method.
url = s3GeneratePresignedURL("my-bucket", "uploads/new.txt", dateAdd("n", 15, now()), "PUT");
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.