<<<Back to Code Testing Page

This example shows the use of the CF function: GetFileFromPath

Code:
<cfset thisPath1 = path_info>
<cfset thisPath2 = ExpandPath("*.*")>
<cfset thisDirectory1 = GetDirectoryFromPath(thisPath1)>
<cfset thisDirectory2 = GetDirectoryFromPath(thisPath2)>
<cfset thisFile = GetFileFromPath(thisPath1)>

<cfoutput>
The current directory is: #thisDirectory1# (using "thisDirectory1")
The current directory is: #thisDirectory2# (using "thisDirectory2")
The current file name is: #thisFile#
</cfoutput>

Results:
The current directory is:\ (using "thisDirectory1")
The current directory is: D:\home\hnt20b004\www_public\dev\test_code\paths\ (using "thisDirectory2")

The current file name is