\\UNC and ASP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David R.

    \\UNC and ASP

    I have two servers. One contains the ASP web application (\\Server1) and
    the other contains the data files (\\Server2).

    I'm having some problem with the following "file download" code at line
    "adoStream.Load FromFile(FPath) ".

    The error is "ADODB.Stre am error '800a0bba' / File could not be opened."

    Could someone please offer some suggestions?


    <%
    Response.Buffer = False
    Server.ScriptTi meout = 30000
    Response.Conten tType = "applicatio n/x-unknown" ' arbitrary

    fn = "MyPhoto.jp g"
    fpath = "\\Server2\g$\f iles\MyPhoto.jp g"

    Response.AddHea der "Content-Disposition", "attachment ; filename=" & fn
    Set adoStream = CreateObject("A DODB.Stream")
    chunk = 2048

    adoStream.Open( )
    adoStream.Type = 1
    adoStream.LoadF romFile(FPath)
    iSz = adoStream.Size
    Response.AddHea der "Content-Length", iSz
    For i = 1 To iSz \ chunk
    If Not Response.IsClie ntConnected Then Exit For
    Response.Binary Write adoStream.Read( chunk)
    Next

    If iSz Mod chunk 0 Then
    If Response.IsClie ntConnected Then
    Response.Binary Write adoStream.Read( iSz Mod chunk)
    End If
    End If

    adoStream.Close
    Set adoStream = Nothing
    Response.End
    %>


  • Egbert Nierop \(MVP for IIS\)

    #2
    Re: \\UNC and ASP


    "David R." <davidrnoreply@ nospam.comwrote in message
    news:eIZXdB8vGH A.4880@TK2MSFTN GP04.phx.gbl...
    >I have two servers. One contains the ASP web application (\\Server1) and
    >the other contains the data files (\\Server2).
    >
    I'm having some problem with the following "file download" code at line
    "adoStream.Load FromFile(FPath) ".
    >
    The error is "ADODB.Stre am error '800a0bba' / File could not be opened."
    >
    Could someone please offer some suggestions?
    >
    >
    <%
    Response.Buffer = False
    Server.ScriptTi meout = 30000
    Response.Conten tType = "applicatio n/x-unknown" ' arbitrary
    >
    fn = "MyPhoto.jp g"
    fpath = "\\Server2\g$\f iles\MyPhoto.jp g"

    This only works, if the anonymous user account IUSR_ has access rights over
    the network, and by default, it has not.

    Comment

    • David R.

      #3
      Re: \\UNC and ASP

      Could you please tell me how to set that up?

      Thank you.


      "Egbert Nierop (MVP for IIS)" <egbert_nierop@ nospam.invalidw rote in
      message news:OwiXrT9vGH A.2432@TK2MSFTN GP06.phx.gbl...
      >
      "David R." <davidrnoreply@ nospam.comwrote in message
      news:eIZXdB8vGH A.4880@TK2MSFTN GP04.phx.gbl...
      >>I have two servers. One contains the ASP web application (\\Server1) and
      >>the other contains the data files (\\Server2).
      >>
      >I'm having some problem with the following "file download" code at line
      >"adoStream.Loa dFromFile(FPath )".
      >>
      >The error is "ADODB.Stre am error '800a0bba' / File could not be opened."
      >>
      >Could someone please offer some suggestions?
      >>
      >>
      ><%
      >Response.Buffe r = False
      >Server.ScriptT imeout = 30000
      >Response.Conte ntType = "applicatio n/x-unknown" ' arbitrary
      >>
      >fn = "MyPhoto.jp g"
      >fpath = "\\Server2\g$\f iles\MyPhoto.jp g"
      >
      >
      This only works, if the anonymous user account IUSR_ has access rights
      over the network, and by default, it has not.
      >

      Comment

      • Bob Barrows [MVP]

        #4
        Re: \\UNC and ASP


        David R. wrote:
        Could you please tell me how to set that up?
        >
        Thank you.
        >
        >
        "Egbert Nierop (MVP for IIS)" <egbert_nierop@ nospam.invalidw rote in
        message news:OwiXrT9vGH A.2432@TK2MSFTN GP06.phx.gbl...
        >>
        >"David R." <davidrnoreply@ nospam.comwrote in message
        >news:eIZXdB8vG HA.4880@TK2MSFT NGP04.phx.gbl.. .
        >>I have two servers. One contains the ASP web application
        >>(\\Server1) and the other contains the data files (\\Server2).
        >>>
        >>I'm having some problem with the following "file download" code at
        >>line "adoStream.Load FromFile(FPath) ".
        >>>
        >>The error is "ADODB.Stre am error '800a0bba' / File could not be
        >>opened."
        >>>
        >>Could someone please offer some suggestions?
        >>>
        >>>
        >><%
        >>Response.Buff er = False
        >>Server.Script Timeout = 30000
        >>Response.Cont entType = "applicatio n/x-unknown" ' arbitrary
        >>>
        >>fn = "MyPhoto.jp g"
        >>fpath = "\\Server2\g$\f iles\MyPhoto.jp g"
        >>
        >>
        >This only works, if the anonymous user account IUSR_ has access
        >rights over the network, and by default, it has not.
        --
        Microsoft MVP -- ASP/ASP.NET
        Please reply to the newsgroup. The email account listed in my From
        header is my spam trap, so I don't check it very often. You will get a
        quicker response by posting to the newsgroup.


        Comment

        • David R.

          #5
          Re: \\UNC and ASP

          I recreated the IUSR/IWAM accounts reset/resynced passwords on the remote
          server and gave them Full Control (figuring it was permissions thing).

          However this did not fix it and I still receive the same message.

          Here are my questions
          1. What permissions are need for the ADODB.Stream to read a remote
          filesystem (ie., what security context is it currently running under, please
          don't say SYSTEM)?

          2. If this is not possible are there any alternatives to the ADODB.Stream to
          download a file from a remote filesystem?



          "Bob Barrows [MVP]" <reb01501@NOyah oo.SPAMcomwrote in message
          news:e3nLYf9vGH A.976@TK2MSFTNG P05.phx.gbl...

          David R. wrote:
          >Could you please tell me how to set that up?
          >>
          >Thank you.
          >>
          >>
          >"Egbert Nierop (MVP for IIS)" <egbert_nierop@ nospam.invalidw rote in
          >message news:OwiXrT9vGH A.2432@TK2MSFTN GP06.phx.gbl...
          >>>
          >>"David R." <davidrnoreply@ nospam.comwrote in message
          >>news:eIZXdB8v GHA.4880@TK2MSF TNGP04.phx.gbl. ..
          >>>I have two servers. One contains the ASP web application
          >>>(\\Server1 ) and the other contains the data files (\\Server2).
          >>>>
          >>>I'm having some problem with the following "file download" code at
          >>>line "adoStream.Load FromFile(FPath) ".
          >>>>
          >>>The error is "ADODB.Stre am error '800a0bba' / File could not be
          >>>opened."
          >>>>
          >>>Could someone please offer some suggestions?
          >>>>
          >>>>
          >>><%
          >>>Response.Buf fer = False
          >>>Server.Scrip tTimeout = 30000
          >>>Response.Con tentType = "applicatio n/x-unknown" ' arbitrary
          >>>>
          >>>fn = "MyPhoto.jp g"
          >>>fpath = "\\Server2\g$\f iles\MyPhoto.jp g"
          >>>
          >>>
          >>This only works, if the anonymous user account IUSR_ has access
          >>rights over the network, and by default, it has not.
          >
          --
          Microsoft MVP -- ASP/ASP.NET
          Please reply to the newsgroup. The email account listed in my From
          header is my spam trap, so I don't check it very often. You will get a
          quicker response by posting to the newsgroup.
          >
          >

          Comment

          • Egbert Nierop \(MVP for IIS\)

            #6
            Re: \\UNC and ASP


            "David R." <davidrnoreply@ nospam.comwrote in message
            news:Oxpb0k%23v GHA.5044@TK2MSF TNGP05.phx.gbl. ..
            >I recreated the IUSR/IWAM accounts reset/resynced passwords on the remote
            >server and gave them Full Control (figuring it was permissions thing).
            >
            However this did not fix it and I still receive the same message.
            >
            Here are my questions
            1. What permissions are need for the ADODB.Stream to read a remote
            filesystem (ie., what security context is it currently running under,
            please don't say SYSTEM)?
            >
            2. If this is not possible are there any alternatives to the ADODB.Stream
            to download a file from a remote filesystem?
            What he means that you reconfigure IUSR account.

            Create a network user account, that is not a 'guest' member.
            Then apply that user to the anonymous account, and make sure that the
            \\SERVER\SHARE also allows that user and the NTFS permission on that remote
            file system allows that user.

            Comment

            • David R.

              #7
              Re: \\UNC and ASP

              So, on \\Server1, I would change the password for Server1\IUSR_Se rver1 in
              IIS.

              Then on \\Server2, I would create Server2\IUSR_Se rver1 account with the same
              password.

              Is this correct?


              "Egbert Nierop (MVP for IIS)" <egbert_nierop@ nospam.invalidw rote in
              message news:ezzZfzIwGH A.4920@TK2MSFTN GP06.phx.gbl...
              >
              "David R." <davidrnoreply@ nospam.comwrote in message
              news:Oxpb0k%23v GHA.5044@TK2MSF TNGP05.phx.gbl. ..
              >>I recreated the IUSR/IWAM accounts reset/resynced passwords on the remote
              >>server and gave them Full Control (figuring it was permissions thing).
              >>
              >However this did not fix it and I still receive the same message.
              >>
              >Here are my questions
              >1. What permissions are need for the ADODB.Stream to read a remote
              >filesystem (ie., what security context is it currently running under,
              >please don't say SYSTEM)?
              >>
              >2. If this is not possible are there any alternatives to the ADODB.Stream
              >to download a file from a remote filesystem?
              >
              What he means that you reconfigure IUSR account.
              >
              Create a network user account, that is not a 'guest' member.
              Then apply that user to the anonymous account, and make sure that the
              \\SERVER\SHARE also allows that user and the NTFS permission on that
              remote file system allows that user.
              >

              Comment

              • Egbert Nierop \(MVP for IIS\)

                #8
                Re: \\UNC and ASP


                "David R." <davidrnoreply@ nospam.comwrote in message
                news:u1kkWDLwGH A.724@TK2MSFTNG P05.phx.gbl...
                So, on \\Server1, I would change the password for Server1\IUSR_Se rver1 in
                IIS.
                >
                Then on \\Server2, I would create Server2\IUSR_Se rver1 account with the
                same password.
                >
                Is this correct?
                No, since IUSR_ blah has no access rights on the network share.

                Just create DOMAIN\IUSR_bla h

                and on both IIS servers, you configure these accounts, by applying them.

                These accounts, must be user accounts. It's a penalty in security so be
                aware of that.

                Comment

                Working...