Returns YES if the file specified in the argument exists; otherwise, returns NO.
FileExists(absolute_path)
DirectoryExists,
ExpandPath,
GetTemplatePath
Parameter |
Description |
---|---|
absolute_path |
A absolute path |
<!--- This example shows the use of FileExists ---> <html> <head> <title> FileExists Example </title> </head> <body bgcolor = silver> <H3>FileExists Example</H3> <cfset thisPath = ExpandPath("*.*")> <cfset thisDirectory = GetDirectoryFromPath(thisPath)> <cfoutput> The current directory is: #GetDirectoryFromPath(thisPath)# <cfif IsDefined("FORM.yourFile")> <cfif FORM.yourFile is not ""> <cfset yourFile = FORM.yourFile> <cfif FileExists(ExpandPath(yourfile))> <P>Your file exists in this directory. You entered the correct file name, #GetFileFromPath("#thisPath#/#yourfile#")# <cfelse> ...