Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFdirectory

Status
Not open for further replies.

theevilone

IS-IT--Management
Aug 19, 2001
52
GB
I am using CFDIRECTORY to display the contents of a directory, but I want to pass the value of a variable into the path. I have tried the method below, without success.

<cfset #test# = &quot;e:\web\xyz\#variable#\images&quot;>

<CFDIRECTORY directory = #test# NAME=&quot;myDirectory&quot; SORT=&quot;name ASC, size DESC&quot; action=&quot;LIST&quot;>

Can anyone suggest a way of listing the contents of a directory, using this, or another method.

Thanks in advance.
 
Hi,
you are trying to set a variable with a variable name
Remove the '#' and it wil work fine.

<cfset #test# = &quot;e:\web\xyz\#variable#\images&quot;>

<cfset test = &quot;e:\web\xyz\#variable#\images&quot;>

<cfdirectory
action=&quot;LIST&quot;
directory=&quot;#test#&quot;
name=&quot;myDirectory&quot;
sort=&quot;name ASC, size DESC&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top