I've created an online application which works well as long as someone has uploaded a resume. We now have positions available where a resume is optional, but the system throws an error if there's no file in the que.
I've tried IsDefined and StructKeyExists and can't get it to work. Any suggestions are greatly appreciated...
<cfset destination = expandPath("./uploads")>
<cfif IsDefined('form.submitapp')>
<cfif IsDefined("form.uploadfile")>
<cffile action="upload" filefield="uploadfile" destination="#destination#" nameConflict="makeUnique">
<cfif isDefined("CFFILE.serverFile")>
<cfset form.resume = CFFILE.serverFile>
</cfif>
</cfif>
<cfinsert tablename=...
structKeyExistsdo not check the field value. They check whether a field is defined. So be sure you are using the correct comparisons for the job. - Leigh<cftry><cffile...><cfset....><cfcatch>An error with the upload occurred.</cfcatch></cftry>. Resolve this problem first so you're not trapping a simple logical error. - Regular Jo