How can I get a list of files in a directory?
Use the <cfdirectory> tag. Don't forget to use the recurse="true" attribute if you want the list to include the contents of subdirectories.
<cfdirectory action="list"
directory="#getDirectoryFromPath(getTemplatePath())#"
name="currentDir">
<cfoutput query="currentDir">
#name#<br>
</cfoutput>
directory="#getDirectoryFromPath(getTemplatePath())#"
name="currentDir">
<cfoutput query="currentDir">
#name#<br>
</cfoutput>
This question was written by Jeremy Petersen.
It was last updated on February 28, 2006 at 8:46:38 AM EST.
CFML Referenced
GetTemplatePath()
<cfdirectory>
<cfoutput>
Categories
Comments
There are no comments for this entry.