I don't know that you can.

I would store that info in the database; it could be a flag which simply
indicates the existence of the file or not.

You could write a CF page to update the db as often as necessary (once,
hourly, daily, etc.); that page would check to see if the file exists, then
update the db.  (Don't update the db for each record; loop through your
productnums, delete productnums that don't have graphic file, then do one db
update along the lines of "update <table> set hasGraphic = 1 where
productnum in (<listOfProductNums>)"



-----Original Message-----
From: Tony Schreiber [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 2:06 AM
To: CF-Talk
Subject: Broken Images / Testing for file existence


I have an application where I list several items on a page and display an
image for that item based on a reference number (ie, productnum+.jpg). The
database table does not tell me whether there is an image for that item
and there are many that do have one.

I'd like to display an alternate image (or nothing at all) when there is
no image present, but I can't see using an <CFIF FileExists> for every
item for 50 or so on a page. Plus, I can't even do that because I'm
grabbing the images from a different server via http only (<IMG
SRC="http://otherserver/path/number.jpg>)...

How can I avoid displaying broken images?


Tony Schreiber, Senior Partner                  Man and Machine, Limited
mailto:[EMAIL PROTECTED]                   http://www.technocraft.com

http://www.linktoss.com _______The Fastest Way to Send a Link to Anyone!
http://www.digitacamera.com ______________DigitA Camera Scripts and Tips
http://www.is300.net ___________The Enthusiast's Home of the Lexus IS300
http://www.cfug-sfl.org ___________South Florida Cold Fusion Users Group
http://www.simplemessageboard.com ___Free Forum Software for Cold Fusion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to