Checking a URL

G

Guest

Hi Folks,

I have run into a bit of an issue with checking for files.
Some files reside on Server X and some on Server Y.

The page with all the links is on Server X. If the file exists we display a
link, if it does not then we display "sorry not yet available".

For the files on server X it is no problem I use an FSO and don't have a
problem. For files on server Y I am having a big problem.

How do I checck to see if these files exist? I was using the code below but
that actually gets the file and some of the files are 50 MB or more.

Dim objHTTP
Dim sHTML
Dim strURL
strURL = BaseProt & RemoteServer & "...rest of path ...=" & URLplacet7
Dim strchkURL
strchkURL = BaseProt & RemoteServer & "...rest of path ..." &
Session("xortho") & ".tif"
Set objHTTP = Server.CreateObject ("Microsoft.XMLHTTP")
objHTTP.open "GET", strchkURL, False
objHTTP.send
sHTML=objHTTP.statusText
If err Or sHTML<>"OK" Then
Response.Write "Not Yet Available<br />"
Else
Response.Write("<a href='" & BaseProt & RemoteServer & "...rest of path
....?FindFile=" & URLplacet7 & "'>" & Session("xortho") & ".tif</a><br />")
End If
Set objHTTP=Nothing

Does anyone have any suggestions for me?

Thank you,
 
J

Jeff Dillon

Use FSO to check for files on the remote server also?

Did you try this? Did you get an error?

Jeff
 
G

Guest

No ...

I said that FSO is used to check if the file exists on the same server as
the file where the links are created.

My problem is checking to see if a file exists on a remote server without
having to download the whole file using Microsoft.XMLHTTP.

Any ideas?

Jeff Dillon said:
Use FSO to check for files on the remote server also?

Did you try this? Did you get an error?

Jeff
 
J

Jeff Dillon

Um..yes, use FSO? Do you have network access to the remote server? You
won't be able to get access to the filesytem otherwise, unless you expose an
object on the remote server, such as a webservice.

Jeff

Phil Lamey said:
No ...

I said that FSO is used to check if the file exists on the same server as
the file where the links are created.

My problem is checking to see if a file exists on a remote server without
having to download the whole file using Microsoft.XMLHTTP.

Any ideas?
 

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

Top