<CFFILE ACTION="READ" FILE="s3://keens-test-bucket/testfile.txt" variable="data">
Using CFFILE to access object with public-read access
<img src="https://s3-us-west-2.amazonaws.com/#s3.bucket#/HappyFace.jpg">
Calling image with public-read access via http url
<cfinclude template="credentials/awscredentials.cfm">
Include credentials.cfm to provide "s3.accessKeyId" and s3.awsSecretKey" when using CFFILE with private S3 buckets and objects
<cfset fileName = "s3://#s3.accessKeyId#:#s3.awsSecretKey#@#s3.bucket#/assets/crmDocs/#xmlPacketName#">
Setting the file name for use with CFFILE. File name includes "s3.accessKeyId", "s3.awsSecretKey" and object name with S3 bucket structure
<CFFILE ACTION="READ" FILE="#fileName#" variable="data">
<CFFILE ACTION="WRITE" FILE="#fileName#" OUTPUT="#registrationXML#" addNewLine="no" charSet="utf-8">
<CFFILE ACTION="DELETE" FILE="#fileName#">
Examples of using CFFILE for READ, WRITE, COPY and DELETE of private objects
<cfset fileName2 = "s3://#s3.bucket#/assets/crmDocs/#xmlPacketName#">
<CFFILE ACTION="COPY" SOURCE="#fileName2#" DESTINATION="s3://keens-test-bucket/testfile.txt" >
Setting the file name without the "s3.accessKeyId", "s3.awsSecretKey". This will work assuming the credentials are in the APPLICATION.CFC
****If you have set the accessKeyID and awsSecretKey in both the URL and Application.cfc, the value provided in the URL takes precedence.****
CREDENTIALS CFDIRECTORY CFFILE COLDFUSION INTERFACING WITH AWS