/web_root/gallery.cfm /web_root/images/someImage.jpg /web_root/images/noImage.jpg
On gallery.cfm:
<cfif FileExists(ExpandPath('images/') & query.someImage)>
<img src="images/#query.someImage#">
<cfelse>
<img src="images/noImage.jpg">
</cfif>
<!---
ExpandPath() takes a relative path and returns its full physical path.
FileExists() requires the full physical path to a file.
--->HTH,
Adrian
Bailey, Neal wrote:
Here is another one... Is there a way to check "if image exist" in CF? I have some image names in
the database that are pointing to an image that does not exist. Therefore I
get the little red X in IE. I would like to instead display and alternate
image. Something like "No Image available". I know how to do this if the
entry in the DB is null or blank but not sure what to do if it has a proper
value. Neal Bailey
Internet Marketing Manager
UGA-Association Field Services
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To unsubscribe: Send UNSUBSCRIBE to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org
