Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Replcae Broken Images

Reply
Thread Tools

Replcae Broken Images

 
 
Jake
Guest
Posts: n/a
 
      10-17-2005
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!


 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      10-17-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)

 
Reply With Quote
 
 
 
 
Bob Lehmann
Guest
Posts: n/a
 
      10-18-2005
Search for FileSystemObject and then read up on the Exists method.

Bob Lehmann

"Jake" <(E-Mail Removed)> wrote in message
news:e3bQ4%(E-Mail Removed)...
> 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!
>
>



 
Reply With Quote
 
AlanM
Guest
Posts: n/a
 
      10-18-2005
try the fileexists method of FileSystemObject

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


"Jake" <(E-Mail Removed)> wrote in message
news:e3bQ4%(E-Mail Removed)...
> 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!
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why are "broken iterators" broken? Steven D'Aprano Python 8 09-28-2008 09:19 PM
Re: Why are "broken iterators" broken? Fredrik Lundh Python 0 09-22-2008 04:32 PM
Re: Why are "broken iterators" broken? Cameron Simpson Python 0 09-22-2008 04:32 AM
Firefox 1.0.6 Keeps Loading up Broken Images Zygon Curry Firefox 9 09-12-2005 05:11 AM
Broken Images ASP.NET/IIS Problem Jacob ASP .Net 7 02-29-2004 03:49 PM



Advertisments