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.

Categories

File and Directory Access

Comments

comments powered by Disqus