Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CLIENTFILE is undefined in CFFILE

Status
Not open for further replies.

jlathem

Technical User
Jul 25, 2010
27
Trying to edit a record, the edit form has a file input that could upload an image but doesn’t have to.

When I try to process the form I send it to an action page and get error 'Element CLIENTFILE is undefined in CFFILE.'

Any suggestions?

Thanks,
James

Code:
<cfif not isdefined("CFFile.ClientFile")> <!--- even tried ( CFFile.ClientFile )---> 
            <CFQUERY NAME="update_no_photo_Change" DATASOURCE="bc_gallery">
                UPDATE gallery
                 SET
                     PhotoCaption = '#FORM.PhotoCaption#'
                    ,Status = '#FORM.Status#'
                WHERE
                  RecordID = #FORM.RecordID#
                </CFQUERY>
<cfelse>
    <cffile action="UPLOAD" filefield="PhotoName" destination="c:\websites\qy9b8789\gallery\images" nameconflict="overwrite">

        <cfset locPhotoName = CFFile.ClientFile>

        
                <CFQUERY NAME="update" DATASOURCE="bc_gallery">
                UPDATE gallery
                 SET
                     PhotoName = '#locPhotoName#'
                    ,PhotoCaption = '#FORM.PhotoCaption#'
                    ,Status = '#FORM.Status#'
                WHERE
                  RecordID = #FORM.RecordID#
                </CFQUERY> 
</cfif>

<html>
   <head>
      <!--- <meta http-equiv="refresh" content="25; index.cfm"> --->
      <title>Update</title>
   </head>
<body bgcolor="FDC689"><br /> <br />
   <!--- This code is just a test to see what was saved. Once code ir complete it will be removed and a CFLOCATION will be put in its place --->

<cfoutput> 
  #locPhotoName#<br />
  #FORM.PhotoCaption#<br />
  #FORM.Status#<br />
</cfoutput>

</body>
</html
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top