<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>GETFILEFROMPATH</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">GETFILEFROMPATH</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Extracts a filename from an absolute path.
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Returns</span>
<p>
Filename, as a string. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
System functions
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Function syntax</span><pre>GetFileFromPath(path)
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
ExpandPath, GetCurrentTemplatePath
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Parameters</span>
<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;h3&gt;GetFileFromPath Example&lt;/h3&gt;
&lt;cfset thisPath = ExpandPath(&quot;*.*&quot;)&gt;
&lt;cfset thisDirectory = GetDirectoryFromPath(thisPath)&gt;
&lt;cfoutput&gt;
The current directory is: #GetDirectoryFromPath(thisPath)#
&lt;cfif IsDefined(&quot;FORM.yourFile&quot;)&gt;
&lt;cfif FORM.yourFile is not &quot;&quot;&gt;
&lt;cfset yourFile = FORM.yourFile&gt;
&lt;cfif FileExists(ExpandPath(yourfile))&gt;
      &lt;p&gt;Your file exists in this directory. You entered the correct file 
name, #GetFileFromPath(&quot;#thisPath#/#yourfile#&quot;)#
   &lt;cfelse&gt;
      &lt;p&gt;Your file was not found in this directory:
      &lt;br&gt;Here is a list of the other files in this directory:
      &lt;!--- use CFDIRECTORY to give the contents of the snippets 
directory, order by name and size ---&gt;
      &lt;CFDIRECTORY 
         DIRECTORY = &quot;#thisDirectory#&quot;
         name = &quot;myDirectory&quot;
         SORT = &quot;name ASC, size DESC&quot;&gt;
      &lt;!--- Output the contents of the CFDIRECTORY as a CFTABLE ---&gt;
      &lt;CFTABLE QUERY = &quot;myDirectory&quot;&gt;
      &lt;CFCOL HEADER = &quot;NAME:&quot; TEXT = &quot;#Name#&quot;&gt;
   &lt;CFCOL HEADER = &quot;SIZE:&quot; TEXT = &quot;#Size#&quot;&gt;
...
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="PATH">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PATH</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>


<p>Absolute path (drive, directory, filename, and extension)</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
