On Fri, 27 Sep 2002 15:09:19 +0100, Stephen Moretti wrote:

> > It works except for one thing. When I click on the link displaying the
> directory
> > structure I want listed from the database it only shows me the files
> within that
> > directory but  *no* subdirectories?
> >
> 
> So what are you saying? That you want a directory browser that is restricted
> at the top level eg. D:\ by COOKIE.DisplaySelect and listing directories
> only, but isn't restricted after that?

Exactly. Sorry for not being clear.

> 
> So....
> 
> <!--- this code is in a template called dirtest.cfm --->
> <cfparam name="url.directorypath" default="c:\">
> 
> <cfdirectory action="LIST" directory="#url.directorypath#" name="DirListing"
> sort="type ASC, name ASC">
> 
> <cfcookie name="DisplaySelect" value="inetpub,mysql,winnt">
> 
> <cfoutput query="DirListing">
>  <cfif DirListing.name IS "..">
>   <cfset nextpath =
> ListDeleteAt(url.directorypath,listlen(url.directorypath,"\"),"\")>
>  <cfelseif DirListing.name IS ".">
>   <cfset nextpath = url.directorypath>
>  <cfelse>
>   <cfset nextpath = url.directorypath&name&"\">
>  </cfif>
> 
>     <cfif ListLen(url.directorypath,"\") EQ 1>
>         <cfif DirListing.type IS "dir" AND
> ListFindNoCase(cookie.DisplaySelect,DirListing.name)>
>             <a href="dirtest.cfm?directorypath=#nextpath#">#name#</a><BR>
>          </cfif>
>  <cfelse>
>   <cfif DirListing.type IS "dir">
>             <a href="dirtest.cfm?directorypath=#nextpath#">#name#</a><BR>
>   <cfelse>
>   #name#<BR>
>   </cfif>
> 
>     </cfif>
> </cfoutput>
> 
> Be aware that this will not give you nice nested directory listings, but
> only listings of the current folder, directories listed first followed by
> files.
> 
> dirtest.cfm used in the link is the name of the file that contains this
> code, so it is self referencing.  No need for one file for top level and
> other files for other level directories.
> 
> Once again, change the names to protect the innocent... ;o)
> 
> Is this all making sense?

Yes...now it is.

Thanks Stephen.

> Regards
> 
> Stephen
> 
> 
> 
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Archives: http://www.mail-archive.com/cf-community@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to