Skip to content

Instantly share code, notes, and snippets.

@atuttle
atuttle / Amazon S3 Upload.cfm
Created January 28, 2013 19:11
Upload files to Amazon S3 with ColdFusion. This is heavily based on code from Joe Danziger's s3.cfc: http://amazons3.riaforge.org/
<cffunction name="uploadToAmazonS3">
<cfargument name="fileName" required="true" />
<cfargument name="contentType" required="true" />
<cfargument name="data" required="true" />
<cfargument name="acl" default="public-read" />
<cfargument name="storageClass" default="STANDARD" />
<cfargument name="HTTPtimeout" default="300" />
<cfargument name="bucket" default="#getProperty('EmailAttachmentS3Bucket')#" />
<cfargument name="accessKeyId" default="#getProperty('EmailAttachmentS3AccessKeyId')#" />
<cfargument name="secretKey" default="#getProperty('EmailAttachmentS3SecretKey')#" />