Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Getting Started / November 2007



Tip: Looking for answers? Try searching our database.

can CF "detect" if a file exists on the web server, or not?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dax Trajero - 26 Nov 2007 18:39 GMT
A database query returns rows of information
Each row contains a part number
I want an anchor around the part number which opens an image called
(partnumber).jpg eg. dr117.jpg
Trouble is, half the part numbers have jpgs and the other half don't
So, if there isn't a file called dr11.jpg I need Cold Fusion to inform this to
the user

Is this possible?
paross1 - 26 Nov 2007 18:51 GMT
You might want to take a look at the http://livedocs.adobe.com/coldfusion/7/htmldocs/00000461.htm function.

Phil
CFMXPrGrmR - 26 Nov 2007 18:52 GMT
Check that there's a value in the image field, if it's blank ignore outputting
the image src tag.

<cfif myQueryName.imgField NEQ "">
   <img src="#myQueryName.imgField#" width="imgWidthHere"
height="imgHeightHere">
</cfif>

imgField would be the source name of the image, like dr117.jpg. Is this what
you are looking for?
cf_dev2 - 26 Nov 2007 20:51 GMT
FileExists(..) sounds like what you're looking for.
Dax Trajero - 26 Nov 2007 23:11 GMT
fantastic - is there anything coldfusion CAN'T do ?!?!
cf_dev2 - 26 Nov 2007 23:23 GMT
Wash your car or pick up your dry cleaning ;-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.