Fileexists - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

FileExists

Description
Determines whether a file exists.
Returns
Yes, if the file specified in the parameter exists; No, otherwise.
Category
System
functions,
Function syntax
FileExists(absolute_path)
See also
DirectoryExists, ExpandPath,
Parameters
Parameter
absolute_path
Example
<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>
472
Chapter 3: ColdFusion Functions
Decision functions
GetTemplatePath
Description
An absolute path

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents