Skip to main content
Inspiring
July 21, 2008
Answered

CFDIRECTORY and results paging?

  • July 21, 2008
  • 2 replies
  • 583 views
I realize this is probably a stupid question, but is there way to use something like recordset paging when displaying the files within a particular folder on a server?

My code:

<cfset DIRECTORY="#ExpandPath("..\docs\#url.dir#\")#">

<cfdirectory action="LIST"
directory="#directory#"
name="files"
sort="name">

From that point, I have the list of files output in the correct directory, based on the URL parameter. I could end up with having 300 plus images in the list that is being displayed as a result of the CFDIRECTORY tag. Is there any way to split up the list? Is there something I could do with the filter option within CFDIRECTORY?

Thanks!
This topic has been closed for replies.
Correct answer Newsgroup_User
ssailer wrote:
> I realize this is probably a stupid question, but is there way to use something
> like recordset paging when displaying the files within a particular folder on a
> server?
>

Well I would say your favorite record set pager would be a logical
choice. The result of a <cfdirectory ...> tag *is* a record set and
behaves just like any other record set be they from <cfquery...>,
<cfstoredprocedure...>, <cfldap...> or any other tag that returns a
record set.

2 replies

ssailerAuthor
Inspiring
July 21, 2008
yay! it worked! Thank you so much!
Newsgroup_UserCorrect answer
Inspiring
July 21, 2008
ssailer wrote:
> I realize this is probably a stupid question, but is there way to use something
> like recordset paging when displaying the files within a particular folder on a
> server?
>

Well I would say your favorite record set pager would be a logical
choice. The result of a <cfdirectory ...> tag *is* a record set and
behaves just like any other record set be they from <cfquery...>,
<cfstoredprocedure...>, <cfldap...> or any other tag that returns a
record set.