Lucee Function Reference

s3listbucket()

List all objects in a bucket

Example

s3listbucket(string bucketName,[any listener,[numeric blockfactor,[string accessKeyId,[string secretAccessKey,[string host,[number timeout]]]]]]):query

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Default Value Description
bucketName string  Yes   Name of the bucket to list objects from.  
listener any  No   Optional. Defines the target where the downloaded data will be directed.
If a file path is provided, the data is saved to that path, the file path must be provided with help of the function "fileOpen" like this [fileOpen(path,"write")].
If a closure or function is given, it will be invoked with parts of the downloaded data as its argument.
The function should accept a single argument named 'line' for line-by-line processing,
'string{Number}' for string blocks of a specified size,
or 'binary{Number}' for binary blocks of a specified size.
The function should return a boolean value: returning false will stop further reading from S3,
while true will continue the process.
If this argument is omitted, the function returns the downloaded data directly.  
blockfactor numeric  No 1000  
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