CFDIRECTORY AND AWS
<cfdirectory action="list" directory="s3://keens-test-bucket" name="dirList">
<cfdump var="#dirList#">

In our first example we are using the cfdirectory tag to access the keens-test-bucket, which was created with "public-read" access enabled. Notice that the only information we are providing is the bucket name and telling ColdFusion we are accessing an S3 bucket.



<cfinclude template="credentials/awscredentials.cfm">
<cfdirectory action="list" directory="s3://#s3.accessKeyId#:#s3.awsSecretKey#@keens-bucket" name="dirList">
<cfdump var="#dirList#" >

In this example we are using cfdirectory to list all the items in our S3 bucket keens-bucket which is private. Notice we are including a credentials file this time. In the cfdirectory tag you can see that we are providing security credentials to the tag. One nice thing about access S3 buckets and content using cfdirectory and cffile is that you provide the Access Key Id and secret key and ColdFusion creates the signature value that normally would be passed to the S3 bucket verify you have authentication and authorization.



CREDENTIALS   CFDIRECTORY   CFFILE   COLDFUSION INTERFACING WITH AWS