469,354 Members | 2,035 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

file exists on remote server

Currently we have a site that allows users to listen to mp3 files. It
is creating bandwidth issues. So we want to move the mp3 files to an
ISP that caps bandwidth usage. Ours is currently burstable.

Now I am able to do the following:
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.fileExists(music_file) Then
'show music file
Else
'do not show a link for file
End If
set fs = nothing

Is it possible to do the same thing, but on a remote server?

Thanks.

Jul 19 '05 #1
6 8263
This question has been asked at least twice in the last 24 hours in this
group.
See: "copy files on network" posted by Marjus Weber and \\share\directory\
posted by Ed

Cheers
Ken

"Jennifer Smith" <je******@nospam.com> wrote in message
news:41***************@nospam.com...
Currently we have a site that allows users to listen to mp3 files. It
is creating bandwidth issues. So we want to move the mp3 files to an
ISP that caps bandwidth usage. Ours is currently burstable.

Now I am able to do the following:
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.fileExists(music_file) Then
'show music file
Else
'do not show a link for file
End If
set fs = nothing

Is it possible to do the same thing, but on a remote server?

Thanks.

Jul 19 '05 #2
Thanks Ken.

Maybe I am mistaken, but they are talking about servers within their domain.
I am trying to see if a file exists on a remote server outside our domain.

Anyone have some ideas???

Ken Schaefer wrote:
This question has been asked at least twice in the last 24 hours in this
group.
See: "copy files on network" posted by Marjus Weber and \\share\directory\
posted by Ed

Cheers
Ken

"Jennifer Smith" <je******@nospam.com> wrote in message
news:41***************@nospam.com...
Currently we have a site that allows users to listen to mp3 files. It
is creating bandwidth issues. So we want to move the mp3 files to an
ISP that caps bandwidth usage. Ours is currently burstable.

Now I am able to do the following:
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.fileExists(music_file) Then
'show music file
Else
'do not show a link for file
End If
set fs = nothing

Is it possible to do the same thing, but on a remote server?

Thanks.


Jul 19 '05 #3
if you dont have file level access then no, you cant.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Jennifer Smith" <je******@nospam.com> wrote in message
news:41***************@nospam.com...
Thanks Ken.

Maybe I am mistaken, but they are talking about servers within their
domain.
I am trying to see if a file exists on a remote server outside our domain.

Anyone have some ideas???

Ken Schaefer wrote:
This question has been asked at least twice in the last 24 hours in this
group.
See: "copy files on network" posted by Marjus Weber and
\\share\directory\
posted by Ed

Cheers
Ken

"Jennifer Smith" <je******@nospam.com> wrote in message
news:41***************@nospam.com...
> Currently we have a site that allows users to listen to mp3 files. It
> is creating bandwidth issues. So we want to move the mp3 files to an
> ISP that caps bandwidth usage. Ours is currently burstable.
>
> Now I am able to do the following:
> Set fs = CreateObject("Scripting.FileSystemObject")
> If fs.fileExists(music_file) Then
> 'show music file
> Else
> 'do not show a link for file
> End If
> set fs = nothing
>
> Is it possible to do the same thing, but on a remote server?
>
> Thanks.
>

Jul 19 '05 #4
If the files will under a web-server on the remote server (you can download
them directly using URLs) then you can do a HEAD request and see if it
exists (and possibly how large it is).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
<%@ LANGUAGE="VBSCRIPT"%>
<%
'check to see if url returns a file
'
option explicit

dim xmlhttp
dim targetsite
dim targeturl

Response.ContentType = "text/plain"
Response.Buffer = false

targetsite="http://www.ielearning.com/"
targeturl = targetsite & "i/wbtmanlogo.gif"

'get a component that can do a HEAD request
'for Windows NT this component may be downloaded at www.microsoft.com/xml
set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP")

'************************
'See if the target url exist
'************************
xmlhttp.open "HEAD", targeturl, false

'send HEAD request
xmlhttp.send

Response.Write xmlhttp.status & " - " & xmlhttp.statusText & vbCrlf
Response.Write xmlhttp.getAllResponseHeaders

%>

Returns:

200 - OK
Server: Microsoft-IIS/4.0
Connection: keep-alive
Date: Thu, 16 Sep 2004 15:08:44 GMT
Content-Type: image/gif
Accept-Ranges: bytes
Last-Modified: Wed, 15 Sep 2004 20:58:36 GMT
ETag: "8092b0c4669bc41:5cc3"
Content-Length: 2417
"Jennifer Smith" <je******@nospam.com> wrote in message
news:41***************@nospam.com...
Thanks Ken.

Maybe I am mistaken, but they are talking about servers within their domain. I am trying to see if a file exists on a remote server outside our domain.

Anyone have some ideas???

Ken Schaefer wrote:
This question has been asked at least twice in the last 24 hours in this
group.
See: "copy files on network" posted by Marjus Weber and \\share\directory\ posted by Ed

Cheers
Ken

"Jennifer Smith" <je******@nospam.com> wrote in message
news:41***************@nospam.com...
Currently we have a site that allows users to listen to mp3 files. It
is creating bandwidth issues. So we want to move the mp3 files to an
ISP that caps bandwidth usage. Ours is currently burstable.

Now I am able to do the following:
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.fileExists(music_file) Then
'show music file
Else
'do not show a link for file
End If
set fs = nothing

Is it possible to do the same thing, but on a remote server?

Thanks.

Jul 19 '05 #5
Thank you very much Mark!!!

That is exactly what I needed :)
Mark Schupp wrote:
If the files will under a web-server on the remote server (you can download
them directly using URLs) then you can do a HEAD request and see if it
exists (and possibly how large it is).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com

<%@ LANGUAGE="VBSCRIPT"%>
<%
'check to see if url returns a file
'
option explicit

dim xmlhttp
dim targetsite
dim targeturl

Response.ContentType = "text/plain"
Response.Buffer = false

targetsite="http://www.ielearning.com/"
targeturl = targetsite & "i/wbtmanlogo.gif"

'get a component that can do a HEAD request
'for Windows NT this component may be downloaded at www.microsoft.com/xml
set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP")

'************************
'See if the target url exist
'************************
xmlhttp.open "HEAD", targeturl, false

'send HEAD request
xmlhttp.send

Response.Write xmlhttp.status & " - " & xmlhttp.statusText & vbCrlf
Response.Write xmlhttp.getAllResponseHeaders

%>

Returns:

200 - OK
Server: Microsoft-IIS/4.0
Connection: keep-alive
Date: Thu, 16 Sep 2004 15:08:44 GMT
Content-Type: image/gif
Accept-Ranges: bytes
Last-Modified: Wed, 15 Sep 2004 20:58:36 GMT
ETag: "8092b0c4669bc41:5cc3"
Content-Length: 2417

"Jennifer Smith" <je******@nospam.com> wrote in message
news:41***************@nospam.com...
Thanks Ken.

Maybe I am mistaken, but they are talking about servers within their

domain.
I am trying to see if a file exists on a remote server outside our domain.

Anyone have some ideas???

Ken Schaefer wrote:
This question has been asked at least twice in the last 24 hours in this
group.
See: "copy files on network" posted by Marjus Weber and \\share\directory\ posted by Ed

Cheers
Ken

"Jennifer Smith" <je******@nospam.com> wrote in message
news:41***************@nospam.com...
> Currently we have a site that allows users to listen to mp3 files. It
> is creating bandwidth issues. So we want to move the mp3 files to an
> ISP that caps bandwidth usage. Ours is currently burstable.
>
> Now I am able to do the following:
> Set fs = CreateObject("Scripting.FileSystemObject")
> If fs.fileExists(music_file) Then
> 'show music file
> Else
> 'do not show a link for file
> End If
> set fs = nothing
>
> Is it possible to do the same thing, but on a remote server?
>
> Thanks.
>


Jul 19 '05 #6
Do you have some kind of file share access between the two? If so then:
a) create an account on the fileserver (serverB) that has the same name and
password as the process identity on ServerA (IIS Server)
b) create a share that has appropriate permissions for this account
c) ensure that you aren't restricting authentication to Kerberos only (ie
NTLM or LanMan is required)

Cheers
Ken

"Jennifer Smith" <je******@nospam.com> wrote in message
news:41***************@nospam.com...
Thanks Ken.

Maybe I am mistaken, but they are talking about servers within their
domain.
I am trying to see if a file exists on a remote server outside our domain.

Anyone have some ideas???

Ken Schaefer wrote:
This question has been asked at least twice in the last 24 hours in this
group.
See: "copy files on network" posted by Marjus Weber and
\\share\directory\
posted by Ed

Cheers
Ken

"Jennifer Smith" <je******@nospam.com> wrote in message
news:41***************@nospam.com...
> Currently we have a site that allows users to listen to mp3 files. It
> is creating bandwidth issues. So we want to move the mp3 files to an
> ISP that caps bandwidth usage. Ours is currently burstable.
>
> Now I am able to do the following:
> Set fs = CreateObject("Scripting.FileSystemObject")
> If fs.fileExists(music_file) Then
> 'show music file
> Else
> 'do not show a link for file
> End If
> set fs = nothing
>
> Is it possible to do the same thing, but on a remote server?
>
> Thanks.
>

Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Kevin Forbes | last post: by
2 posts views Thread by Glen Conway | last post: by
1 post views Thread by AtulTiwari | last post: by
2 posts views Thread by MarkusJ_NZ | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.