Unless you want the left hand side variable name to be dynamic, then 
you
don't need the pounds.  
i.e.  <CFIF Left(x, 6) IS "Image_">
(The dynamic bit would be something like <cfif "MyVar_#x#" eq SomeVal>)

Next, I would do a trim and upper case around the 'x' variable to 
ensure you
are always comparing apples to apples
i.e.  <CFIF Left(ucase(trim(x)), 6) IS "IMAGE_">

And finally, you do not need the CFOUTPUT tags in this case - it's a 
given
when you are dealing with strings in most of the CF tags.  You would
normally only use CFOUTPUT when you are putting values to the page for
presentation.

HTH

Shawn Grover

-----Original Message-----
From: Bruce Sorge [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 8:20 AM
To: CF-Talk
Subject: CFFile


I am using CF File to upload some files to a server. The problem is 
that the
field name is dynamically created. So, since I do not know the exact 
name of
the field, I am trying use the dynamic field name. The problem is that 
I
cannot use # signs in the filefield attribute. Any assistance would be
appreciated. Below is my code. 

<CFLoop List = "#FORM.FieldNames#" Index = "x"> 
     <CFOutput> 
        <CFIF #Left(x, 6)# IS "Image_"> 
<cffile action="UPLOAD" filefield="#Evaluate(x)#"
destination="c:\Web\cars\Master\CarImages\" 
nameconflict="OVERWRITE"> 
<cfquery datasource="#Application.DSN#" name="qInsertCoupon"> 
Insert Into Image (V_ID, Img_Location) 
Values (1, '#File.ServerDirectory#\#File.ServerFile#') 
</cfquery> 
         </CFIF> 
       </CFOutput> 
   </CFLoop> 

______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to