I am building a photo gallery that I don't want to plug into a DB for quick re-usability. When a user uploads an image it uploads the image into a folder called photos and every user has there own folder titled #firstname#_#lastname# in that folder. The directory query keeps the folder name in a variable called directory and the file name in a variable called name. So I have cfscript that will pull the folder name and then the file name and push them together.
CODE
<cfdirectory action="list" directory="#localphotopath#" name="PhotoDirectory" listinfo="all" recurse="yes" type="file">
<cfdump var="#PhotoDirectory#" expand="no">
<table cellpadding="3" cellspacing="3" border="0">
<thead>
<tr>
<th colspan="4">Full Photo Gallery</th>
</tr>
<tr>
<td colspan="4" align="left"><a href="/choosegallery.cfm">View Photo's By Name</a></td>
</tr>
</thead>
<tbody>
<cfset col = 0>
<cfoutput query="photodirectory">
<cfscript>
file = photodirectory.name;
filefolder = listGetAt(directory,5,"\");
</cfscript>
<!---fullpath = filefolder & "/" & file;--->
<cfdump var="#filefolder#"><br>
<cfdump var="#file#">
</cfoutput>
</tbody>
</table>
The problem is that when I dump the file variable it returns an empty structure, but when I dump the full cfdirectory variable it shows file names in the name column.