Checking a URL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phil Lamey

    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.CreateOb ject ("Microsoft.XML HTTP")
    objHTTP.open "GET", strchkURL, False
    objHTTP.send
    sHTML=objHTTP.s tatusText
    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
  • Jeff Dillon

    #2
    Re: Checking a URL

    Use FSO to check for files on the remote server also?

    Did you try this? Did you get an error?

    Jeff
    "Phil Lamey" <PhilLamey@disc ussions.microso ft.com> wrote in message
    news:5A0BC6E7-68AD-4EAF-9E78-A02B99A6A74A@mi crosoft.com...[color=blue]
    > 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[/color]
    a[color=blue]
    > 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[/color]
    but[color=blue]
    > 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.CreateOb ject ("Microsoft.XML HTTP")
    > objHTTP.open "GET", strchkURL, False
    > objHTTP.send
    > sHTML=objHTTP.s tatusText
    > 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[/color]


    Comment

    • Phil Lamey

      #3
      Re: Checking a URL

      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.XMLHT TP.

      Any ideas?

      "Jeff Dillon" wrote:
      [color=blue]
      > Use FSO to check for files on the remote server also?
      >
      > Did you try this? Did you get an error?
      >
      > Jeff
      > "Phil Lamey" <PhilLamey@disc ussions.microso ft.com> wrote in message
      > news:5A0BC6E7-68AD-4EAF-9E78-A02B99A6A74A@mi crosoft.com...[color=green]
      > > 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[/color]
      > a[color=green]
      > > 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[/color]
      > but[color=green]
      > > 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.CreateOb ject ("Microsoft.XML HTTP")
      > > objHTTP.open "GET", strchkURL, False
      > > objHTTP.send
      > > sHTML=objHTTP.s tatusText
      > > 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[/color]
      >
      >
      >[/color]

      Comment

      • Jeff Dillon

        #4
        Re: Checking a URL

        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" <PhilLamey@disc ussions.microso ft.com> wrote in message
        news:C9C386B7-839F-4735-9593-3913CDE2D6C7@mi crosoft.com...[color=blue]
        > 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.XMLHT TP.
        >
        > Any ideas?
        >
        > "Jeff Dillon" wrote:
        >[color=green]
        > > Use FSO to check for files on the remote server also?
        > >
        > > Did you try this? Did you get an error?
        > >
        > > Jeff
        > > "Phil Lamey" <PhilLamey@disc ussions.microso ft.com> wrote in message
        > > news:5A0BC6E7-68AD-4EAF-9E78-A02B99A6A74A@mi crosoft.com...[color=darkred]
        > > > 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[/color][/color][/color]
        display[color=blue][color=green]
        > > a[color=darkred]
        > > > 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[/color][/color][/color]
        a[color=blue][color=green][color=darkred]
        > > > 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[/color][/color][/color]
        below[color=blue][color=green]
        > > but[color=darkred]
        > > > 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.CreateOb ject ("Microsoft.XML HTTP")
        > > > objHTTP.open "GET", strchkURL, False
        > > > objHTTP.send
        > > > sHTML=objHTTP.s tatusText
        > > > If err Or sHTML<>"OK" Then
        > > > Response.Write "Not Yet Available<br />"
        > > > Else
        > > > Response.Write( "<a href='" & BaseProt & RemoteServer & "...rest of[/color][/color][/color]
        path[color=blue][color=green][color=darkred]
        > > > ...?FindFile=" & URLplacet7 & "'>" & Session("xortho ") & ".tif</a><br[/color][/color][/color]
        />")[color=blue][color=green][color=darkred]
        > > > End If
        > > > Set objHTTP=Nothing
        > > >
        > > > Does anyone have any suggestions for me?
        > > >
        > > > Thank you,
        > > >
        > > > --
        > > > Phil Lamey, EIT
        > > > CGI Consultant[/color]
        > >
        > >
        > >[/color][/color]


        Comment

        Working...