473,322 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 1724
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ville Mattila | last post by:
Hello readers, I'm trying to install the latest PHP4 version from the scratch. The configure string is following: ../configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-curl...
7
by: - ions | last post by:
I have created a JComboBox with its Items as a list of "M" numbers ie. M1,M2,M3.......throgh too M110 (thes are the messier objects, a catolouge of deep sky objects) the user selects of of these...
5
by: Tongu? Yumruk | last post by:
I have a little proposal about type checking in python. I'll be glad if you read and comment on it. Sorry for my bad english (I'm not a native English speaker) A Little Stricter Typing in Python...
6
by: Web Developer | last post by:
Hi, I come across the term "type checking" very often in my readings on C++, and have never heard it in Java. Besides the simplistic answer that it checks the "type", what more does it mean? ...
22
by: Qopit | last post by:
Hi there, I'm pretty new to Python and am trying to figure out how to get "will this code compile?"-like code checking. To me this is a pretty basic language/environment requirement, especially...
4
by: Patient Guy | last post by:
Does anyone have any coding rules they follow when doing argument checking? When arguments fail during check, do you return from the call with an ambiguous return value, or do you throw...
16
by: lawrence k | last post by:
I've made it habit to check all returns in my code, and usually, on most projects, I'll have an error function that reports error messages to some central location. I recently worked on a project...
125
by: jacob navia | last post by:
We hear very often in this discussion group that bounds checking, or safety tests are too expensive to be used in C. Several researchers of UCSD have published an interesting paper about this...
7
by: polas | last post by:
Afternoon everyone. I have a quick question about standard C. Generally speaking, in my experience, whenever one accesses an array there is never any bounds checking done (either statically...
4
by: BillE | last post by:
I have found articles on line about using word interop for spell checking with visual studio applications. Most of the articles are several years old, though - VS2003, maybe 2005. I couldn't...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.