Hey gang,

Here's a piece of code I'm working on. Something does not make sense to me.
The code work's fine in terms of displaying the directory structure of the
folder. The funny part is that if there are no folders in the directory
cfelse does not kick in. Any pointers where my error lies?

<cfdirectory directory="#request.file_path#media\assets\" action="list"
name="dirlist">

<cfset temp=ValueList(dirlist.name, ",")>

<cfif ListLen(temp, ",") NEQ 0>
        <cfoutput>
        <cfloop from="1" to=#ListLen(temp)# index="abc">

                <cfset found=ListContains(temp, ".")>
                <cfif found GT 0>
                        <cfset temp=ListDeleteAt(temp, found, ",")>
                </cfif>

                <cfset found=ListContains(temp, "..")>
                <cfif found GT 0>
                        <cfset temp=ListDeleteAt(temp, found, ",")>
                </cfif>

                <cfset found=ListContains(temp, ".cfm")>
                <cfif found GT 0>
                        <cfset temp=ListDeleteAt(temp, found, ",")>
                </cfif>
                <cfset temp=ListSort(temp, "Text")>
        </cfloop>
        <cfloop list="#temp#" index="dirname">
                <a
href="#GetDirectoryFromPath(GetTemplatePath())##dirname#">#dirname#</a><br>
        </cfloop>
        </cfoutput>
<cfelse>
        There are no folders available
</cfif>
<cfoutput>
#ListLen(temp, ",")#
</cfoutput>


______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to