Click to See Complete Forum and Search --> : FileSystemObject problem


stevem2004
06-23-2005, 05:53 AM
Hi,

I am trying to use the code below to determine whether a file exists on a server and thus if the site is online or offline. However it is not working.

Can someone tell me if it is possible to do what I am trying?


<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

If (fs.FileExists ("http://server/folder/file.asp"))=true Then
Response.Write("<font face=verdana size=1 color=green><b>Online</b></font>")
Else
Response.Write("<font face=verdana size=1 color=red><b>Offline</b></font>&nbsp;<font face=verdana size=1 color=black>Please use backup systems</font>")
End If

set fs=nothing
%>


TIA Steve

buntine
06-23-2005, 06:33 AM
the FileSystemObject object is to represent the local (the servers) file system. So it cannot be used to determine whether a Web Site located at a different server is active.

See the following for information on pinging servers from ASP: http://www.google.com.au/search?biw=1003&hl=en&q=asp+ping&meta=

Regards.