What I want to accomplish is to have the user's file renamed to a designated 
name once it passes validation. The validation works in checking that the form 
field is not empty nor contains a file that is not designated. However, using 
the following code, the file still gets uploaded:

 
<cftry>
<cffile
action="UPLOAD"
filefield="nominationLetter"
destination="#destination#"
nameconflict="MAKEUNIQUE"
/>
<!--- Create variable to reference the original document name and extension 
uploaded from client.--->
<cfset clientNominationLetter = #file.ClientFile#>
<!---Create variable to reference renamed document. Retain orignal file 
extension.--->
<cfset renameNomination = "01_nominationLetter"&"."&#cffile.clientFileExt#>
 
<!---Rename uploaded document using variable. Save renamed document to original 
destination.--->
<cffile action="rename"
source="#destination##File.ServerFile#"
destination="#destination##Trim(renameNomination)#">
Within the cftry blocks, I've replaced 
file="#CFFILE.ServerDirectory#\#CFFILE.ServerFile#"
with 
file="#destination##File.ServerFile#"

which is my designated file location. What am I missing? 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5361
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm

Reply via email to