469,927 Members | 1,747 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Checking a URL

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,

--
Phil Lamey, EIT
CGI Consultant
Jul 21 '05 #1
3 1574
Use FSO to check for files on the remote server also?

Did you try this? Did you get an error?

Jeff
"Phil Lamey" <Ph*******@discussions.microsoft.com> wrote in message
news:5A**********************************@microsof t.com...
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,

--
Phil Lamey, EIT
CGI Consultant

Jul 21 '05 #2
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" wrote:
Use FSO to check for files on the remote server also?

Did you try this? Did you get an error?

Jeff
"Phil Lamey" <Ph*******@discussions.microsoft.com> wrote in message
news:5A**********************************@microsof t.com...
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,

--
Phil Lamey, EIT
CGI Consultant


Jul 21 '05 #3
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" <Ph*******@discussions.microsoft.com> wrote in message
news:C9**********************************@microsof t.com...
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" wrote:
Use FSO to check for files on the remote server also?

Did you try this? Did you get an error?

Jeff
"Phil Lamey" <Ph*******@discussions.microsoft.com> wrote in message
news:5A**********************************@microsof t.com...
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,

--
Phil Lamey, EIT
CGI Consultant


Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by - ions | last post: by
5 posts views Thread by Tongu? Yumruk | last post: by
6 posts views Thread by Web Developer | last post: by
22 posts views Thread by Qopit | last post: by
4 posts views Thread by Patient Guy | last post: by
125 posts views Thread by jacob navia | last post: by
7 posts views Thread by polas | last post: by
4 posts views Thread by BillE | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.