cfloop w/ FileExists, color coding presence or not


hello,

 

cf version: 8

 

i have fifty(50) records returned query below. want loop through those

records see if associated file exists on server. if file does

exist display file name in green text if not display in red.

 

my current code picks first file exist , sets color green

as rest of document information. know fact of

the documents missing, of documents names should displaying

in red. output correctly displaying records, not changing colors

respectfully presence of file.

 

what doing wrong? going wrong?

 

<cfloop query="rsdocuments">

<cfoutput>

<div style="margin-bottom: 15px;">

#disp_title#<br />

<cfif fileexists(#filepath#)>

<span style="color: ##093;">#doc_file#</span>

<cfelse>

<span style="color: ##f00;">#doc_file#</span>

</cfif>

</div>

</cfoutput>

</cfloop>

 

thanks in advance insight.

 

leonard b

first thing i'd display #filepath# loop, make sure contains expectign contain. can see if there pattern being found , not.

 

--- ben



More discussions in ColdFusion


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account