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!

Re: Replcae Broken Images by Evertjan

Evertjan
Mon Oct 17 16:30:02 CDT 2005

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".

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Re: Replcae Broken Images by Bob

Bob
Mon Oct 17 19:16:33 CDT 2005

Search for FileSystemObject and then read up on the Exists method.

Bob Lehmann

"Jake" <spamthis@alltel.net> wrote in message
news:e3bQ4%2310FHA.908@tk2msftngp13.phx.gbl...
> 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!
>
>



Re: Replcae Broken Images by AlanM

AlanM
Tue Oct 18 03:44:32 CDT 2005

try the fileexists method of FileSystemObject

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


"Jake" <spamthis@alltel.net> wrote in message
news:e3bQ4%2310FHA.908@tk2msftngp13.phx.gbl...
> 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!
>
>