file exists on remote server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jennifer Smith

    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("S cripting.FileSy stemObject")
    If fs.fileExists(m usic_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.

  • Ken Schaefer

    #2
    Re: file exists on remote server

    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\directo ry\
    posted by Ed

    Cheers
    Ken

    "Jennifer Smith" <jennifer@nospa m.com> wrote in message
    news:4148AA5A.9 2BF59CB@nospam. com...[color=blue]
    > 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("S cripting.FileSy stemObject")
    > If fs.fileExists(m usic_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.
    >[/color]


    Comment

    • Jennifer Smith

      #3
      Re: file exists on remote server

      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:
      [color=blue]
      > 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\directo ry\
      > posted by Ed
      >
      > Cheers
      > Ken
      >
      > "Jennifer Smith" <jennifer@nospa m.com> wrote in message
      > news:4148AA5A.9 2BF59CB@nospam. com...[color=green]
      > > 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("S cripting.FileSy stemObject")
      > > If fs.fileExists(m usic_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.
      > >[/color][/color]

      Comment

      • Curt_C [MVP]

        #4
        Re: file exists on remote server

        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" <jennifer@nospa m.com> wrote in message
        news:41499849.D BACC19F@nospam. com...[color=blue]
        > 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:
        >[color=green]
        >> 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\directo ry\
        >> posted by Ed
        >>
        >> Cheers
        >> Ken
        >>
        >> "Jennifer Smith" <jennifer@nospa m.com> wrote in message
        >> news:4148AA5A.9 2BF59CB@nospam. com...[color=darkred]
        >> > 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("S cripting.FileSy stemObject")
        >> > If fs.fileExists(m usic_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.
        >> >[/color][/color]
        >[/color]


        Comment

        • Mark Schupp

          #5
          Re: file exists on remote server

          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



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

          dim xmlhttp
          dim targetsite
          dim targeturl

          Response.Conten tType = "text/plain"
          Response.Buffer = false

          targetsite="htt p://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.CreateOb ject("MSXML2.Se rverXMLHTTP")

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

          'send HEAD request
          xmlhttp.send

          Response.Write xmlhttp.status & " - " & xmlhttp.statusT ext & vbCrlf
          Response.Write xmlhttp.getAllR esponseHeaders

          %>

          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: "8092b0c4669bc4 1:5cc3"
          Content-Length: 2417


          "Jennifer Smith" <jennifer@nospa m.com> wrote in message
          news:41499849.D BACC19F@nospam. com...[color=blue]
          > Thanks Ken.
          >
          > Maybe I am mistaken, but they are talking about servers within their[/color]
          domain.[color=blue]
          > I am trying to see if a file exists on a remote server outside our domain.
          >
          > Anyone have some ideas???
          >
          > Ken Schaefer wrote:
          >[color=green]
          > > 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[/color][/color]
          \\share\directo ry\[color=blue][color=green]
          > > posted by Ed
          > >
          > > Cheers
          > > Ken
          > >
          > > "Jennifer Smith" <jennifer@nospa m.com> wrote in message
          > > news:4148AA5A.9 2BF59CB@nospam. com...[color=darkred]
          > > > 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("S cripting.FileSy stemObject")
          > > > If fs.fileExists(m usic_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.
          > > >[/color][/color]
          >[/color]


          Comment

          • Jennifer Smith

            #6
            Re: file exists on remote server

            Thank you very much Mark!!!

            That is exactly what I needed :)


            Mark Schupp wrote:
            [color=blue]
            > 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="VBSCR IPT"%>
            > <%
            > 'check to see if url returns a file
            > '
            > option explicit
            >
            > dim xmlhttp
            > dim targetsite
            > dim targeturl
            >
            > Response.Conten tType = "text/plain"
            > Response.Buffer = false
            >
            > targetsite="htt p://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.CreateOb ject("MSXML2.Se rverXMLHTTP")
            >
            > '************** **********
            > 'See if the target url exist
            > '************** **********
            > xmlhttp.open "HEAD", targeturl, false
            >
            > 'send HEAD request
            > xmlhttp.send
            >
            > Response.Write xmlhttp.status & " - " & xmlhttp.statusT ext & vbCrlf
            > Response.Write xmlhttp.getAllR esponseHeaders
            >
            > %>
            >
            > 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: "8092b0c4669bc4 1:5cc3"
            > Content-Length: 2417
            >
            > "Jennifer Smith" <jennifer@nospa m.com> wrote in message
            > news:41499849.D BACC19F@nospam. com...[color=green]
            > > Thanks Ken.
            > >
            > > Maybe I am mistaken, but they are talking about servers within their[/color]
            > domain.[color=green]
            > > I am trying to see if a file exists on a remote server outside our domain.
            > >
            > > Anyone have some ideas???
            > >
            > > Ken Schaefer wrote:
            > >[color=darkred]
            > > > 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[/color][/color]
            > \\share\directo ry\[color=green][color=darkred]
            > > > posted by Ed
            > > >
            > > > Cheers
            > > > Ken
            > > >
            > > > "Jennifer Smith" <jennifer@nospa m.com> wrote in message
            > > > news:4148AA5A.9 2BF59CB@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("S cripting.FileSy stemObject")
            > > > > If fs.fileExists(m usic_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.
            > > > >[/color]
            > >[/color][/color]

            Comment

            • Ken Schaefer

              #7
              Re: file exists on remote server

              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" <jennifer@nospa m.com> wrote in message
              news:41499849.D BACC19F@nospam. com...[color=blue]
              > 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:
              >[color=green]
              >> 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\directo ry\
              >> posted by Ed
              >>
              >> Cheers
              >> Ken
              >>
              >> "Jennifer Smith" <jennifer@nospa m.com> wrote in message
              >> news:4148AA5A.9 2BF59CB@nospam. com...[color=darkred]
              >> > 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("S cripting.FileSy stemObject")
              >> > If fs.fileExists(m usic_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.
              >> >[/color][/color]
              >[/color]


              Comment

              Working...