473,397 Members | 2,028 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,397 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 1730
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.