Google Answers Logo
View Question
 
Q: I need help writing a few lines of simple ASP (vbscript, classic not .net) code. ( No Answer,   3 Comments )
Question  
Subject: I need help writing a few lines of simple ASP (vbscript, classic not .net) code.
Category: Computers > Programming
Asked by: twowaymirrors_net-ga
List Price: $10.00
Posted: 24 Aug 2005 00:16 PDT
Expires: 23 Sep 2005 00:16 PDT
Question ID: 559591
I have a website at http://www.hiddencamstore.com which has a link to
a live cam on another server. The live cam is just a jpg file that
keeps refreshing every 20 seconds on both the website and the server.
Sometimes, however, I do work on my server that requres that I turn
off the cam for a few hours. I want a few lines of code that will
detect that there is no jpg at the destination (or the website is
down), and instead of showing an error message, will show a jpg file
at a different website instead. This should be easy to someone with a
little more ASP (vbscript) experience than I have.

Clarification of Question by twowaymirrors_net-ga on 24 Aug 2005 12:56 PDT
Yes, I am running two servers, so if one is not operating, the other
one should automatically be the one which people will be downloading
the image from. The webserver loads the image off the first server. I
want the script written so that it will automatically try the second
if the first is not running (like if there's a file not found or
server not found error).
Answer  
There is no answer at this time.

Comments  
Subject: Re: I need help writing a few lines of simple ASP (vbscript, classic not .net) code.
From: rajkumarrg-ga on 24 Aug 2005 04:52 PDT
 
Hi
 In Image tag add ALT text as "image not available" or the text as you
wish. Please add Title also else ALT text would be shown on mouse
over.
<IMG SRC="" ALT="Image not available" TITLE="Title">
Subject: Re: I need help writing a few lines of simple ASP (vbscript, classic not .net) code.
From: webxpert-ga on 24 Aug 2005 08:30 PDT
 
Please clarify you question first

is it 2 machine envirnoment?
1 webserver, 1 fileserver(with cam captured in a specific screen)

how  your webserver fetch the live cam's capture?
(through network fileshare or webpage (the picture) on the fileserver ?)
Subject: Re: I need help writing a few lines of simple ASP (vbscript, classic not .net) code.
From: webxpert-ga on 26 Aug 2005 08:56 PDT
 
sorry for late reply, I checked out I can't apply to be researher right now.
Anyway, I can still answer you question as I have finish this research
and don't wanna waste my knowledge.

Here is my answer:

I assume you have make a persistant mapping on the server containing folder

IsFile=false
IsFolder=false
result=0

dim IsFile
dim fs,f,result
dim targetPath
targetPath="s:\pic.jp"         // mapping to path similar 
                               //  to "\\server\camFolder\pic.jpg"


set fs=Server.CreateObject("Scripting.FileSystemObject")

'Identify Folder or File first
	if fs.FileExists(targetPath) then 
		IsFile=true
	end if 
if IsFile then
       //* do your file loading  *//
else
       //* do a redirect to the path containing the replacing picture*//
       // e.g.   Response.redirect "/AnyPath/pic.jpg"
end if

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy