> i need to filter for jpg's AND gif's in <cfdirectory
> filter anyone know how i can do this??
afaik there's not any way to do it naturally, i.e. with a single cfdirectory
call... if you need the list of them in alpha order, odds are you'll have to
do some tinkering... Something like this may work in CF 5:
<cfdirectory action="list" name="rsimg"
sort="name" directory="#expandpath('images')#">
<cfset imgarray = ArrayNew(1)>
<cfloop query="rsimg">
<cfif rsimg.type is "file" and
ListFindNoCase("gif,jpg,jpeg",listlast(rsimg.name,"."))>
<cfset temp = ArrayAppend(imgarray,1)><cfelse>
<cfset temp = ArrayAppend(extarray,0)></cfif>
</cfloop>
<cfset temp = QueryAddColumn(rsimg,"isimg","imgarray")>
<cfquery name="rsimage" dbtype="query">
SELECT * FROM rsimg WHERE isimg = 1
</cfquery>
And at this point the query "rsimage" will hold the info you want.
hope this helps,
Isaac
www.turnkey.to
954-776-0046
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists