<cfparam name="ATTRIBUTES.field"/>
<cfparam name="ATTRIBUTES.output"/>

<cfset setVariable("CALLER.#ATTRIBUTES.output#.ok", "No")/>

<cfif !structKeyExists(FORM, ATTRIBUTES.field)>
	<cfexit method="exittag"/>
</cfif>

<cftry>
	<cffile 
		action="upload" 
		filefield="#ATTRIBUTES.field#" 
		destination="#GetTempDirectory()#/" 
		nameconflict="MAKEUNIQUE"
	/>
	<cfcatch>
		<!---<cfdump var=#cfcatch#/><cfrethrow/>--->
		<cfexit method="exittag"/>	
	</cfcatch>
</cftry>

<cfset pathOnServer="#cffile.ServerDirectory#/#cffile.ServerFile#"/>
<cfset contentType="#cffile.ContentType#/#cffile.ContentSubType#"/>
<cfset fileName="#cffile.ClientFile#"/>

<cffile
	action="ReadBinary"
	file="#pathOnServer#"
	variable="binaryData"
/>

<cffile action="DELETE" file="#pathOnServer#"/>

<cfset setVariable("CALLER.#ATTRIBUTES.output#.fileName", "#fileName#")/>
<cfset setVariable("CALLER.#ATTRIBUTES.output#.contentType", "#contentType#")/>
<cfset setVariable("CALLER.#ATTRIBUTES.output#.binaryData", #binaryData#)/>
<cfset setVariable("CALLER.#ATTRIBUTES.output#.ok", "Yes")/>

<cfexit method="exittag"/>