About
Pricing
Community
Teams
Start Free Trial
Log in
judsonmusic
asked on
4/10/2008
CFDIRECTORY TO GET FOLDER LIST?
Can you use cfdirectory to get a list of folder in a location?????
If not what alternative do I have to do that?
ColdFusion Language
14
1
Last Comment
SidFishes
8/22/2022 - Mon
SidFishes
4/10/2008
just add the TYPE="dir" attribute to your cfdirectory tag
judsonmusic
4/10/2008
ASKER
SID,
How to I also tell it to only look for .jpg files???
SidFishes
4/10/2008
use the Filter="*.jpg" attribute
obviously you can't combine type="dir" and filter="*.jpg"
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
judsonmusic
4/10/2008
ASKER
SID the type attribute was not allowed.
this is my code:
<cfdirectory name="getAlbums" action="list" type="dir" directory="\\Devserver\e\W
ebsites\ju
dsonmusic\
images\">
judsonmusic
4/10/2008
ASKER
Any ideas?
ASKER CERTIFIED SOLUTION
SidFishes
4/10/2008
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SidFishes
4/10/2008
you should remove <cfdump var="#dirsArray#">
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
judsonmusic
4/10/2008
ASKER
in that code, where are you showing the file path to get the folder from?
Can you plug my code elements into it so I can see it work?
SidFishes
4/10/2008
the exmaple just lists all the dir in c:\
<cfdirectory directory="C:\" name="dirQuery" action="LIST">
^
just substitute your cfdirectory
<cfdirectory name="getAlbums" action="list" type="dir" directory="\\Devserver\e\W
ebsites\ju
dsonmusic\
images\">
judsonmusic
4/10/2008
ASKER
oh, so you are using the type in the code to build an array of the folder where these are listed?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
SidFishes
4/10/2008
yes... in cf7 "type" was part of the result struct with a value of "dir" or "file" so you need to loop thru the returned struct and pick out the values with dir as type
judsonmusic
4/10/2008
ASKER
So now in coldfusion 8, you can do it so much simpler huh??
SidFishes
4/10/2008
much simpler yes...
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SidFishes
4/10/2008
need any more help