Directory Explorer CFC

Directory Explorer CFC

Post by pete_freita » Thu, 03 Apr 2003 09:38:45



Here's a custom tag I wrote a while ago, that outputs <option> tags for each directory under the given starting directory. You might also check out http://www.cflib.org
<cfparam name="attributes.basepath" default="">
<cfparam name="attributes.subdir" default="/">
<cfset attributes.subdir = Replace(attributes.subdir, "//", "/", "ALL")>
<cfdirectory action="LIST" directory="#attributes.basepath##attributes.subdir#" name="dir">
<cfoutput><option>#attributes.subdir#</option></cfoutput>
<cfoutput query="dir">
        <cfif dir.name IS NOT "." AND dir.name IS NOT ".." AND type IS "dir">
                <cf_recursedir basepath="#attributes.basepath#" subdir="#attributes.subdir#/#dir.name#">
        </cfif>
</cfoutput>

_________________________________
Pete Freitag
CTO, CFDEV.COM
http://www.cfdev.com
ColdFusion Developer Resources

 
 
 

1. cfc / ajax / must be in root directory

I am just starting to work with the CF 8 ajax. I am finding many in
posts/examples that to get the cfc to work, it must be in the root directory. I
am not finding specific information on what is causing this other than a
conflict with the application.cfm / application.cfc file.
 What is allowed and what is not allowed to go into an application file to
allow .cfc to work in the same directory as the file calling it?

 It is very inconvenient to have to place all the cfc files at the root and not
in the same directory as the file calling it.

 the last example i was working with comes from:

http://www.brucephillips.name/blog/index.cfm/2007/8/8/Updating-and-Ad...
s-Being-Displayed-In-ColdFusion-8s-cfgrid

 which describes the .cfm and .cfc file to be in the same directory. (which
doesnt work) -- but in the comments - there is the example of locating the .cfc
file in the root directory and adding a slash (/) in front of the path. and
this works for me.
 I had the same problem yesterday trying to get the Ben Forta art.cfc
autosuggest example working.

2. IE 5 flaw makes PCs (and Flash) vulnerable

3. How to reference CFC in different directory?

4. Controlling Windows Media Files?

5. Calling CFC from parent directory

6. Buttons Problem

7. How to invoke a CFC from another directory using createObject

8. Adding ASX files to page

9. invoking a CFC in another directory

10. what the cfc-skeletons directory for?

11. Locking down a directory with application.cfc?

12. Post to CFC - Directory Paths