| Contents > CFML Reference > ColdFusion Functions > FileExists |
|
|
|
|
||
Determines whether a file exists.
Yes, if the file specified in the parameter exists; No, otherwise.
System functions, Decision functions
FileExists(absolute_path)
DirectoryExists, ExpandPath, GetTemplatePath
Parameter |
Description |
|---|---|
absolute_path |
An absolute path |
<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>
|
|
||
| Contents > CFML Reference > ColdFusion Functions > FileExists |
|
|
ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 6.1
Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi79.htm
Comments
matthewmazurek said on Jan 24, 2004 at 10:00 PM :