I'm trying to make a UDF that allows me to do this:
uploadFile(destination, form)
The attached code is what I've written... and the dump looks good..
contains the path to the uploaded .tmp file.. In fact, if I change the
code to dump the Form scope, it looks exactly the same.
Why isn't this working?
CFMX 6.1 updated on Windows Server 2003.
- Rick
<cffunction name="uploadFile" output="yes" returnType="struct">
<cfargument name="destination" type="string" required="yes">
<cfargument name="scopeForm" type="Struct" required="yes">
<cfset var retVal = StructNew()>
<cfdump var="#scopeForm#">
<cfset retVal.errorCode = 0>
<cfset retVal.errorMessage = "">
<cftry>
<cffile action="UPLOAD" filefield="scopeForm.uploadFile"
destination="#arguments.destination#" nameconflict="ERROR">
<cfcatch type="any">
<cfset retVal.errorCode = 1>
<cfset retVal.errorMessage = "The file could not be
uploaded due to a
file system error: #cfcatch.message# - #cfcatch.detail#">
</cfcatch>
</cftry>
<cfreturn retVal>
</cffunction>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186467
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54