Marika,
Fairly sure that the directory is returned as a query. What you can
do is loop over the query with a cfloop and query the other table to get the
correct name. Example below
<cfloop query="file_list"> <--- file_list is the name of the cfdirectory
action --->
<cfquery name="correct_name" datasource="whatever">
select *
from name_table
where code = #file_list.filename#
</cfquery>
File name is #correct_name.name#
</cfloop>
Not the best way to do it but it should work.
Brian Knott
-----Original Message-----
From: Marika Auret [mailto:[EMAIL PROTECTED]
Sent: Friday, 25 July 2003 2:24 PM
To: CFAussie Mailing List
Subject: [cfaussie] CFDirectory and listing database contents
Hi folks
I am not sure how to do the following and was wondering if anyone had any
good advice.
I am trying to list the contents of a folder on a webpage using CFDirectory.
I have this part working fine. The only problem is that the filenames of the
documents are named in such a way that they are hard to identify (there are
several hundred of them). However, within each filename is a specific code
that I have referenced within a database that has the filename I would like
to give the file. Confused yet? :-)
I have tried doing a CFDirectory listing and then a cross referenced CFQuery
to try and pick up the correct filename from the database and list both
together but I don't know what the correct way to do this is...and this is
probably the worst way to do it anyhow!!
Does anyone have any experience with doing this and if so how did you?
Thanks in advance - I'll stop pulling my hair out now!
Cheers
Marika
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/