February 2nd, 2004, 02:41 PM
Check for file
What I'm TRYING (and failing) to do is very simple, check a directory for XXX file.
I know the name of the file, and I know the directory. I don't want to do a listing of the directory and then check the list, that would be a huge load on the server...
<cfset xxx = "somefile">
<cfset yyy = "someotherfile">
<cfif XXX file exists>
<cffile copy XXX to YYY>
Sorry the file you are trying to copy does not exist.
I have the cffile line of code, but not the CFIF statement. Any help would be greatly appreciated!
February 2nd, 2004, 08:37 PM
Why not use fileExists()?
<cfif fileExists( absolute_path_to_file )>
February 3rd, 2004, 07:48 AM
DING! Pull me out of the oven! I'M DONE!!!
Thanks kiteless, I knew there HAD to be some very simple way to do this... I searched through my code book and the internet for a few hours yesterday...