Skip to content

Instantly share code, notes, and snippets.

@jsteenkamp
jsteenkamp / upload.cfc
Created July 30, 2011 21:43
ColdFusion code for Plupload file uploading including chunked transfers
<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')){