Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
menotti08 #1
listing a Directory files
hello community
i want to make a directory list
i have pdf documents in a list
101_4326.pdf
101_4325.pdf
201_4324.pdf
201_4328.pdf
but i only want to show the pdf that have the same number that the client
example: id_client = 101 and the pdf is
101_4326.pdf how can i show the files and associate the files with the id?
menotti08 Guest
-
Directory listing
Hi php-general, I'm reading through the filesystem function of php and I can't find any function which will list me all the files which are in a... -
retrieving directory listing
I'm looking for a way to read the contents of a directory from within FlashMX. For example, I'd like to Flash to be able to store a listing of... -
Listing aliased directory
I have in Apache2 (win32) aliased directory, for example: Alias /ftp/mp3/ "D:/mp3/" <Directory "D:/mp3"> .... </Directory> Address to this... -
[PHP] directory listing
Wrong place, look at directory functions ;) Matthias Wulkow wrote: -
CD Directory Listing
Is it possible to get the Directory listing from a CD in order to write it to a searchable database? If so does anyone know where I can get this... -
mpwoodward *TMM* #2
Re: listing a Directory files
menotti08 wrote:
You can probably use the filter function to do that (I'd have to> hello community
> i want to make a directory list
> i have pdf documents in a list
> 101_4326.pdf
> 101_4325.pdf
> 201_4324.pdf
> 201_4328.pdf
> but i only want to show the pdf that have the same number that the client
> example: id_client = 101 and the pdf is
> 101_4326.pdf how can i show the files and associate the files with the id?
>
experiment to be sure):
[url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-a20.htm#wp1097918[/url]
I would think the filter could be something like #clientid#*
If not, cfdirectory returns a query object and you could run a query of
that query to filter.
Matt
--
Matt Woodward
[email]mpwoodward@gmail.com[/email]
Team Macromedia - ColdFusion
mpwoodward *TMM* Guest
-
Abinidi #3
Re: listing a Directory files
Try this:
<cfset id_client = "101">
<cfdirectory action="list" name="Qdir"
directory="C:\directory_path_to_pdf_files">
<cfquery dbtype="query" name="listfiles">
SELECT Name
FROM Qdir
WHERE (Name LIKE '#id_client#%')
</cfquery>
<cfdump var="#listfiles#">
Abinidi Guest
-
menotti08 #4
Re: listing a Directory files
iu think this can help me thx
but i have to test it first
thx for your help
i will mark this when i test it
sorry for my english
menotti08 Guest
-
menotti08 #5
Re: listing a Directory files
ok i have problems with this
<cfset DirList = "C:\Inetpub\wwwroot\test\pdf">
<cfset id_client = "101">
<cfdirectory action="list" name="Qdir" directory="DirList">
<cfquery dbtype="query" name="listfiles" result="menotti">
SELECT 101
FROM Qdir
<!--- WHERE (Name LIKE '#id_client#%') --->
</cfquery>
<cfoutput>#menotti.sql#</cfoutput>
<cfdump var="#listfiles#">
<cfoutput query="listfiles">#dirllist#</cfoutput>
the application dont show the conent of the carpet
the other problem is that i only want
that the application recognize the number 101, or 201 or any number that i
have in the file using the id, so i dont have to put <cfset id_client = "101">
menotti08 Guest
-
jdeline #6
Re: listing a Directory files
There are a few things wrong with what you have.
If you use a variable in the CFDIRECTORY to define the path, you have to wrap
it in #.
Your WHERE clause, commented out, is correct. Remove the comments.
Remove the RESULTS attribute in the CFQUERY. ColdFusion (at least version 5)
does not recognize this.
Change the way you are displaying your results. I have shown a CFOUTPUT loop
of the filename.
I removed the CFDUMP and the CFOUTPUT loop at the end of your code.
<cfset DirList = "C:\Inetpub\wwwroot\test\pdf">
<cfset id_client = "101">
<cfdirectory action="list" name="Qdir" directory="#DirList#">
<cfquery dbtype="query" name="listfiles">
SELECT 101
FROM Qdir
WHERE (Name LIKE '#id_client#%')
</cfquery>
<cfoutput>#name#<BR></cfoutput>
jdeline Guest



Reply With Quote

