redirecting missing image

A

amiro

How do I redirect a non existing image link on my server to another
image?

On a page in "Server A", there's this tag:
< img src="image_url_on_Server_B" >

suppose I want to remove the image from "Server B", and the tag above
will display a different image, which was redirected due the absense
of the original image src.

Is there any solution based on IIS and ASP?

Thanks,
Amiro.
 
S

Steven Burn

<%
Dim FSO
Dim Fl
Set FSO = CreateObject("scripting.filesystemobject")
Set Fl = FSO.GetFile(Server.MapPath("image_on_Server_A.gif"))

If FSO.FileExists(Fl) = True Then
Response.Write "<img src=" & Fl.Path & ">"
Else
Response.Write "<img src='image_on_Server_B.gif'>"
End If

Set FSO = Nothing
Set Fl = Nothing
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 

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
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top