Lucee Function Reference

s3generatepresignedurl()

Generates a presigned URL pointing to the object given. You can provide the endpoint as a bucket/object defintion (S3AddACL(bucket:"mybucket",object:"myobject.txt") ) or as a virtual filesystem path (S3AddACL(path:"s3://mybucket/myobject.txt") ).

Example

s3generatepresignedurl(string bucketNameOrPath,[string objectName,[datetime expireDate,[string httpMethod,[string sseAlgorithm,[string sseCustomerKey,[string checksum,[string type,[string disposition,[string encoding,[string version,[boolean zeroByte,[struct responseHeaders,[string accessKeyId,[string secretAccessKey,[string host,[number timeout]]]]]]]]]]]]]]]]):string

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Default Value Description
bucketNameOrPath string  Yes   This can be the bucketname or a virtual filesystem path for a file/directory (example "s3://mybucket/myobject.txt").  
objectName string  No   Name of the object (path) within the bucket of your object to read. In case you have defined a bucket with the first argument.  
expireDate datetime  No   Date time when the URL should expire.  
httpMethod string  No   The desired HTTP method (e.g., GET, PUT). Defaults to GET.  
sseAlgorithm string  No   The desired server-side encryption algorithm, valid values are AES256 or KMS.  
sseCustomerKey string  No   The server-side encryption customer-provided key.  
checksum string  No   The base64 encoded MD5 checksum of the object's content.  
type string  No   The MIME type of the object (e.g., "text/plain").  
disposition string  No   Specifies presentational information for the object, like "attachment; filename=\"filename.pdf\"".  
encoding string  No   Specifies content encodings applied to the object, like gzip.  
version string  No   The version ID of the object if versioning is enabled.  
zeroByte boolean  No   A flag to specify if the object has zero-byte content.  
responseHeaders struct  No   Struct of custom response headers for custom metadata prefixed with "x-amz-meta-" (prefix is optional, function will add it if missed).  
accessKeyId string  No   S3 accessKeyId, if not defined it checks the system property/environment variable for [lucee.s3.accesskeyid].  
secretAccessKey string  No   S3 secretAccessKey, if not defined it checks the system property/environment variable for [lucee.s3.secretaccesskey].  
host string  No   the provider to connect, if not set Amazon AWS is used.  
timeout number  No 10000 timeout for this execution