FileExists()
Determines whether a file exists
FileExists( source=any, allowRealPath=object );
Returns: Boolean
Argument | Description |
---|---|
source
any,
required
|
a file path or URI. |
allowRealPath
object,
optional
|
boolean that defines if relative paths are interpreted or not |
Examples
var filePath = "path/to/my/file.md";
if(fileExists(filePath)) echo "it exists"
See also
- Decision logic
- File handling
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)