Notice: With the launch of Adobe Cookbooks, this site will no longer be accepting new entries or posting new content. Thanks to everyone who submitted content!

How do I find the file extension for a file?

Use the listLast() function.

<cfset myExt = "myDocument.pdf">
<cfset myExt = listLast(myExt,".")>

<cfoutput>#myExt#</cfoutput>


This question was written by Stefan le Roux.
It was last updated on July 21, 2008 at 9:24:20 AM EDT.

CFML Referenced

<cfoutput>
ListLast()

Categories

File and Directory Access

Comments

There are no comments for this entry.