Replcae Broken Images

J

Jake

Not sure if this can be done with ASP but I would like to find a way
to detect if an image is missing and replace it with a default image instead
of the dreaded RED X showing up.

How can I achieve this?

Thanks in Advance!
 
E

Evertjan.

Jake wrote on 17 okt 2005 in microsoft.public.inetserver.asp.general:
Not sure if this can be done with ASP but I would like to find a way
to detect if an image is missing and replace it with a default image
instead of the dreaded RED X showing up.

Yes, it can be done with ASP,
if you set and use a dedicated 404.asp page.

Start that 404.asp page with something like:

[vbscript]

<%
qstr = lcase(Request.ServerVariables("QUERY_STRING"))
if right(qstr,4)=".jpg" or right(qstr,4)=".gif" then
response.redirect "/images/imageNotFound.gif"
end if
%>

=============

any html on your site, containing:

<img src='/somewhereElseOr/imageNotHere.jpg'>

will display the imageNotFound.gif picture,
which I have bitwize filled with the Dutch equivalent of:
"Sorry, this image is not available just yet".
 
A

AlanM

try the fileexists method of FileSystemObject

this is only good if you have the images on the same machineas your asp app.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top