I have re-written the code and it is working, except that the renaming of the 
files (filefield="#variables.filename#") part is not working. When I dump (see 
code below) the session variable that I am assigning to filefield, I get the 
correct result, but the filename is not changed on upload when I check them at 
where there are stored.


<!--- Assign the productID to a session variable --->
   
    <cflock timeout=20 scope="Session" type="Exclusive">
          <cfset Session.ExtraProductImgName = URL.Cnsmr_ProductID>
    </cflock>

<!--testing for the value of session variable -->
   <cfdump var="#Session.ExtraProductImgName#">


<!---create variable to hold destination of uploaded files--->
<cfset upLoadDestination = "#ExpandPath('images/consumer/')#">
    <cfif isdefined("form.upload")> 
      <cfloop index="i" from="1" to="#Session.numberoffields#" step="1">
           <cfset filename = "#Session.ExtraProductImgName#" & #i#>
             <!--- cfif evaluate(variables.filename) neq "" --->
                  <cffile action="UPLOAD" destination="#upLoadDestination#" 
nameconflict="makeunique" filefield="#variables.filename#">
                 <!---/cfif---> 
          </cfloop>
           
           <!--- Delete the session variable after uploading files related to 
this particular ProductID --->

           <cflock timeout=20 scope="Session" type="Exclusive">
             <cfset StructDelete(Session, "ExtraProductImgName")>
       </cflock>
           
    
    </cfif>
</cfif> <!--- end extra upload processing --->

>Fawzi,
>Are you saying that you removed the nested cf-tags and the problem persists?
>If that is what you are saying, please post your new code as edited, so we
>can see what else might be wrong.
>
>William
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321209
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