I have a situation I am completely baffled with . below is code from the
"action" page and the method pulled out of a CFC.

 

I can't seem to get it to return the "newImageName" variable . when I output
it after the upload it errors out (I have outputted the variable inside of
the method and it outputs the image name just fine.  Is there something I am
doing wrong and not seeing here?

 

Thanks in advance!!

 

<!--- Initialize the object --->

<cfset imageHandler = createObject("component",
"giesenhagen.components.imageHandler") />

 

<!--- Pass in the form collection to "upload" the image --->

<cfset imageHandler.uploadImage(form) />

 

<cfoutput>#newImageName#</cfoutput> <!--- THIS produces an error that
newImageName is not found in variables --->

 

 

 

<!--- Here is the uploadImage method from the CFC --->

<cffunction name="uploadImage" output="false" returnType="string"
hint="Uploads Image to Directory">

                        

            <cffile accept="*" action="upload"
destination="#Application.sitePath#temp#Application.delimiter#"
filefield="image" nameconflict="makeunique">

                        

            <cfset newImageName = file.serverFile />

            <cfreturn newImageName />

</cffunction>

 

 

Paul Giesenhagen

QuillDesign

http://www.quilldesign.com

417-885-1375

 

 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2. 
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271881
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to