This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent> | |
<cffunction name="upload" access="remote" returntype="struct" returnformat="json" output="false"> | |
<cfscript> | |
var uploadDir = expandPath('.') & '/uploads/'; // should be a temp directory that you clear periodically to flush orphaned files | |
var uploadFile = uploadDir & arguments.NAME; | |
var response = {'result' = arguments.NAME, 'id' = 0}; | |
var result = {}; | |
// if chunked append chunk number to filename for reassembly | |
if (structKeyExists(arguments, 'CHUNKS')){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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')#" /> |