4

I want to upload a file into Amazon S3. Is it possible to upload a file into S3 using cffile action="upload" in Adobe's ColdFusion server? When I tried uploading a file, it's throwing an error:

The cause of this exception was: org.apache.commons.vfs2.FileSystemException: Unknown message with code "S3 Error Message."..

My CFFile action code is :

<cffile action="upload" 
      filefield = "FileContents" 
      destination = "s3://accessKey:secretAccesskey@bucketname" 
      nameconflict="makeunique" 
      charset="utf-8">

What mistake am I making here? How can I use cffile action="upload" to upload a file into S3? Some of my friends say that it is working on a Lucee server.

I've also thought about trying to use the cfhttp tag to upload into the S3 bucket, but would like to know how to use cffile action="upload" and what are the supported cffile actions for Amazon S3.

Could anyone help me understand? Thanks much in advance!

Community
  • 1
  • 1
Sathish Chelladurai
  • 670
  • 1
  • 8
  • 23
  • What version of ColdFusion? – James A Mohler Jun 07 '19 at 15:37
  • @JamesAMohler I'm using current CF version - 11,0,08,298512 – Sathish Chelladurai Jun 07 '19 at 15:38
  • What are the IAM permissions for that accessKey/secretKey combination? Adobe CF's built-in support for S3 requires very broad S3 permissions to be established in IAM. You pretty much have to give S3:* permissions to the IAM user that you're trying to connect with if you want to use CF's built-in support for S3. – Brian Jun 07 '19 at 18:22

0 Answers0