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
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