« Previous Next »

Thread: Problem accessing file on remote server using UNC path with IIS7,ASP, ADODB.Stream

Last post 10-02-2008 11:25 PM by amtim. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 10-01-2008, 1:28 AM

    • amtim
    • Not Ranked
    • Joined on 10-01-2008, 1:16 AM
    • Posts 5

    Problem accessing file on remote server using UNC path with IIS7,ASP, ADODB.Stream

    We have this VBScript in our Classic ASP Page

    function LoadAttachment(strFileName)
     Dim objAttachmentStream, strFilePath
     Dim ReadSuccess
     aLocations = Split(AttachmentsRootUNC,";")
     ReadSucess = false
     for each location in aLocations
      on error resume next
      strFilePath = location & strFileName
      set objAttachmentStream = Server.CreateObject("ADODB.Stream")
       objAttachmentStream.Type = 1 'binary
      objAttachmentStream.Open()
      objAttachmentStream.LoadFromFile("\\mediaserver\media\1240939.jpg")
      

                    if Err.number = 0 then
       ReadSuccess = true
       Exit For
      else
       'Response.Write Err.number
       'Response.Write Err.description
       'Response.End
       Err.Clear()
       objAttacmentStream.Close()
       set objAttachmentStream = nothing
      end if 
         on error goto 0   
            next

        if ReadSuccess then
         set LoadAttachment = objAttachmentStream
        else
     set LoadAttachment = nothing
        end if
     
    End Function

    Based on the 6 different scenarios below, we have concluded this must be a mis-configuration on our Windows 2008 IIS7 Web Server.  However everything we have looked at has done nothing thus far.  With so many changes to both Security, IIS, in Windows Server 2008 we have no idea where else to look or what other information may be relevant for this post.

    Scenario 1:  Access Failed

    Server 1 (IIS 7.0 Web Server)
      Windows Server 2008 Web Edition
      Not Domain Member

    Server 2 (Media Server)
      Windows Server 2008 Web Edition
      Domain Member 

    Scenario 2: Access Failed
    Server 1 (IIS 7.0 Web Server)
        Windows Server 2008 Web Edition
         Not Domain Member

    Server 3 (Media Server)
         Windows Server 2003 Web Edition
         Domain Member

    Scenario 3: Access Successful
    Server 1 (IIS 7.0 Web Server)
        Windows Server 2008 Web Edition
         Not Domain Member

    Server 4 (Media Server)
         Linux Variant (network storage system)
         Not Domain Member

    Scenarios 4-6  Access Successful
    Server 5 (IIS 6.0 Web Server)
       Windows Server 2003 Web Edition
       Not Domain Member

    Connects fine to servers 2, 3, and 4 (all different OS's)

    I didn't want to provide too much meaningless information, but if there is anything I omitted, please let me know.

     

     

  • 10-02-2008, 2:19 AM In reply to

    • davcox
    • Top 50 Contributor
    • Joined on 07-21-2006, 2:28 PM
    • Redmond
    • Posts 210

    Re: Problem accessing file on remote server using UNC path with IIS7,ASP, ADODB.Stream

    Mixing non-domain and domain member machines is not going to make a coherent authentication or authorization story for you.  I'd suggest having both machines in a domain so that you can set the share permissions on the file server to allow the user your ASP code is running as to have access. 

  • 10-02-2008, 11:25 PM In reply to

    • amtim
    • Not Ranked
    • Joined on 10-01-2008, 1:16 AM
    • Posts 5

    Re: Problem accessing file on remote server using UNC path with IIS7,ASP, ADODB.Stream

    Thank you davcox.  I am annoyed I didn't do this before I posted this message as I had intended to.  We never truely thought this would be the issue, as it is not the case with our windows 2003 setup.  Thank you!!

Page 1 of 1 (3 items)
Microsoft Communities