View folder recursively how to?
Hi
I am trying to view folder recursively and i make it just like that
<html>
<head>
</head>
<body>
<cfinclude template="download.cfm">
Listing <br>
<cfdirectory directory="\\pl1xpd-16286\shared_data\applet" name="dirQuery" action="LIST" type = "all">
<br>Result<br>
<cfset startupDir ="\\pl1xpd-16286\shared_data\applet">
<cfloop query = "dirQuery">
<cfoutput>
<cfif dirQuery.type EQ "Dir">
<cfoutput>
#dirQuery.name# #dirQuery.type#<br>
</cfoutput>
<cfset newDirPath = "#startupDir#">
<cfset newDirPath &= "\">
<cfset newDirpath &= "#dirQuery.name#">
<cfset listDirectory("#newDirPath#")>
<cfelse >
<cfoutput>
#dirQuery.name# #dirQuery.type# <br>
</cfoutput>
</cfif>
</cfoutput>
</cfloop>
</body>
</html>
<cffunction name = "listDirectory" output = "true">
<cfargument name = "directoryPath" required = "true" type = "string">
<cfdirectory directory="#directoryPath#" name = "dir" action ="list" type="all">
<cfloop query = "dir">
#dir.name# #dir.type#
<cfif dir.type eq "dir">
<cfset newPath ="#directoryPath#">
<cfset newPath &="/">
<cfset newPath &= "#dir.name#">
<cfset listDirectory("#newPath#")>
<cfelse>
<cfoutput>
#dir.name# #dir.type#<br>
</cfoutput>
</cfif>
</cfloop>
<cfreturn>
</cffunction>
What iam doing wrong?
