You need to output the variable, instead you have it as filename:

<cffile action="UPLOAD"
        destination="D:\mypath\mypics"
        nameconflict="makeunique"
        filefield="#filename#">

Ade

-----Original Message-----
From: Las Selasor [mailto:[EMAIL PROTECTED]
Sent: 03 January 2006 17:26
To: CF-Talk
Subject: CFFILE - multiple file uploads


Hi everyone,

I know there is a lot of talk on this tag but I searched for several hours 
yesterday and could not find an answer to the problem I'm having. I am 
dynamically creating upload form fields that I am trying to upload to my 
server. I am receiving a 'The form field specified in the CFFILE tag 
(FILENAME) does not contain an uploaded file' error. I have pasted some of 
my code below. As you'll see, I've hardcoded some variables to allow me to 
troubleshoot:

<!---BUILD THE FILE NAMES AND FILE UPLOAD FIELDS DYNAMICALLY--->
<CFOUTPUT>

<!---PROPERTY LISTING ID FROM DB--->
<!---<CFSET ListingID = #getListingID.MAXID#>--->
<cfset ListingID = '3'>
<input type="hidden" name="State" value="CA">
<input type="hidden" name="NumberOfPics" value="1">

<!---BUILD FILE NAME PREFIX--->
<CFIF ListingID LT 10>
        <CFSET prefix = "0#ListingID#">
        <input type="hidden" name="prefix" value="#prefix#">
<CFELSE>
        <CFSET prefix = "#ListingID#">
        <input type="hidden" name="prefix" value="#prefix#">
</CFIF>

<!---CREATE FILE UPLOAD FIELDS--->
<CFLOOP index="LoopCount" from="1" to="1">

        <CFSET myFileName = "#prefix#_#FORM.State#_image_#LoopCount#">
        <input type="File" name="#myFileName#"/><br />

</CFLOOP>

</CFOUTPUT>
----------------------------------------------
This is my action page:
<CFLOOP index="LoopCount" from="1" to="#FORM.NumberOfPics#">


  <cfset filename = "#FORM.prefix#_#FORM.State#_image_#LoopCount#">

       <cffile action="UPLOAD"
          destination="D:\mypath\mypics"
          nameconflict="makeunique"
          filefield="filename">
<CFOUTPUT>
#filename#
        </CFOUTPUT>
----------------------
thank you,

SR

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228248
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

Reply via email to