s3generatePresignedUrl()
Generates a presigned URL pointing to the object given
Requires Extension: S3 Resource Extension
s3generatePresignedUrl( bucketNameOrPath=string, objectName=string, expireDate=datetime, httpMethod=string, sseAlgorithm=string, sseCustomerKey=string, checksum=string, type=string, disposition=string, encoding=string, version=string, zeroByte=boolean, responseHeaders=struct, accessKeyId=string, secretAccessKey=string, host=string, timeout=number );
Returns: String
| Argument | Description | Default |
|---|---|---|
|
bucketNameOrPath
string,
required
|
edit
This can be the bucketname or simple the virtual filesystem point for the file (if object name is no defined) Alias: bucket, bucketName, path |
|
|
objectName
string,
optional
|
edit
Name of the object (path) within the bucket of your object to read Alias: object, path |
|
|
expireDate
datetime,
optional
|
edit
Date time when the URL should expire. Alias: expire |
|
|
httpMethod
string,
optional
|
edit
The desired HTTP method (e.g., GET, PUT). Defaults to GET. Alias: method |
|
|
sseAlgorithm
string,
optional
|
edit
The desired server-side encryption algorithm, valid values are AES256 or KMS. Alias: algorithm |
|
|
sseCustomerKey
string,
optional
|
edit
The server-side encryption customer-provided key. Alias: customerKey |
|
|
checksum
string,
optional
|
edit
The base64 encoded MD5 checksum of the object's content. Alias: contentMd5 |
|
|
type
string,
optional
|
edit
The MIME type of the object (e.g., "text/plain"). Alias: contentType |
|
|
disposition
string,
optional
|
edit
Specifies presentational information for the object, like "attachment; filename="filename.pdf"". Alias: contentDisposition |
|
|
encoding
string,
optional
|
edit
Specifies content encodings applied to the object, like gzip. Alias: contentEncoding |
|
|
version
string,
optional
|
edit
The version ID of the object if versioning is enabled. Alias: versionId |
|
|
zeroByte
boolean,
optional
|
edit
A flag to specify if the object has zero-byte content. Alias: zeroByteContent |
|
|
responseHeaders
struct,
optional
|
edit
Struct of custom response headers for custom metadata prefixed with "x-amz-meta-" (prefix is optional, function will add it if missed). Alias: customResponseHeaders |
|
|
accessKeyId
string,
optional
|
edit
S3 accessKeyId, if not defined it checks the system property/environment variable for [lucee.s3.accesskeyid]. Alias: accessKey, awsAccessKeyId, awsAccessKey |
|
|
secretAccessKey
string,
optional
|
edit
S3 secretAccessKey, if not defined it checks the system property/environment variable for [lucee.s3.secretaccesskey]. Alias: secretkey, awsSecretkey, awsSecretAccessKey |
|
|
host
string,
optional
|
edit
the provider to connect, if not set Amazon AWS is used. Alias: provider, server |
|
|
timeout
number,
optional
|
edit
timeout for this execution |
10000 |
Examples
There are currently no examples for this function 39,866ms WARN No examples for function S3GeneratePresignedURLSee also
- S3
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)