0

I'm trying to get a list of directories using the <CFDIRECTORY tag but the return dataset is only displaying the files in the directory and not the sub-directories. The directory I'm attempting to query has 1 file and many sub-directories but the result only returns the single file. Does any one have any idea where I should look?

2
Contributors
5
Replies
7
Views
7 Years
Discussion Span
Last Post by arrgh
1
Here's the code - could there be some sort of Admin Setting that prevents the directory files from showing?

<CFDIRECTORY
	  DIRECTORY="#FolderToDisplay#"
	  NAME="DirectoryQuery"
	  SORT="Name ASC" 
	  ACTION="LIST"
	  LISTINFO="ALL" 
	  RECURSE="NO"
	  FILTER="*.*">
<CFOUTPUT>

<CFQUERY DBTYPE="query" NAME="FilesQuery">
	    SELECT Directory,Name,DATELASTMODIFIED,Size,Type FROM DirectoryQuery
	    ORDER BY Directory,Name,DateLastModified desc
</CFQUERY>
0

The problem is the "filter". Using *.* will filter out most directories because they don't have a "." in the name. Remove the filter and cfdirectory will return everything (files and subdirectories).

Edited by arrgh: n/a

0

That did the trick - thanks a lot! I see this used to work in CF5 when they still returned the "." and ".." current and parent directory listings. We're using CF7 now. Thanks again

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.