first of all FYI,

your <cfoutput> tags are somewhat ambiguous...;)

second:

the code i always use is similar and works just fine

<cfloop list="#form.FIELDNAMES#" index="x">
      <cfif x CONTAINS "UPLOADFILE_">
           <cfif (trim(evaluate(x)) IS NOT "")>
                <cffile action="UPLOAD" filefield="#x#"
destination="#request.filePath#" nameconflict="MAKEUNIQUE">

                <cfquery name="ins_some_file" datasource="#request.DSN#">
                     INSERT INTO SOME_FILE(PK_FIELD, FILE_NAME)
                     VALUES(
                                         #pk_value#
                                        '#file.SERVERFILE#'
                                    )
                </cfquery>
           </cfif>
      </cfif>
 </cfloop>

hope this helps..=)

-chris.alvarado
[application developer]
4|Guys Interactive, Inc.
------------------------------------
http://www.4guys.com



----- Original Message -----
From: "Bruce Sorge" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, January 03, 2002 9:19 AM
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>
> 
______________________________________________________________________
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=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to