Skip to main content
Participant
April 23, 2008
Question

Getting a file list

  • April 23, 2008
  • 2 replies
  • 602 views
I am trying to list files in a directory. It is a sub directory of where the script will run. I have the attached code, but it list in the current directory, I need it to look in the 2007_photos directory.
This topic has been closed for replies.

2 replies

Participant
May 13, 2008
Thanks, it worked for me!
April 23, 2008
If you want to list files in a subdirectory of the current template path, you will have to specify the subdirectory:

<cfdirectory action="list"
directory="#getDirectoryFromPath(getTemplatePath())#/mySubdirectory"
name="currentDir">
judson75Author
Participant
April 29, 2008
worked great. now, say I want just the first file in the list? So I can display it as the main image?