Expandpath - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 2: ColdFusion Functions

ExpandPath

Returns a path equivalent to the relative_path appended to the base template path.
Note the following:
ExpandPath creates a platform-appropriate path. You can use either a slash (/)
or a back slash (\) in the specified relative path.
The return value contains a trailing slash (or back slash) if the specified relative
path contains a trailing slash (or back slash).
See also FileExists, GetCurrentTemplatePath, and GetFileFromPath.
Syntax
ExpandPath( relative_path )
relative_path
Any relative path. ExpandPath converts relative directory references (.\ and ..\)to
an absolute path. The function throws an error if this argument or the resulting
absolute path is invalid.
Examples
<!--- This example shows the use of ExpandPath --->
<HTML>
<HEAD>
<TITLE>
ExpandPath Example
</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>ExpandPath 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.
the correct file name, #GetFileFromPath("#thisPath#/#yourfile#")#
<CFELSE>
<P>Your file was not found in this directory:
...
You entered
345

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion 4.5

Table of Contents