Can not access files on different computer

Discussion in 'ASP .Net Security' started by Orit, Aug 8, 2008.

  1. Orit

    Orit Guest

    My solution has an ASP.NET app , a Web Service and a NET dll .
    The ASP.NET application calls to WebService’s methods , which calls
    the dll’s methods .
    One of the functions of the dll is accessing files , which are located
    on different computer. The path is UNC path and it exists . It has the
    following code :

    If My.Computer.FileSystem.FileExists(Path) Then
    ‘ read the image
    End if

    If the application is run directly from Visual Studio 2008 , it works
    just fine and the FileExists returns true.
    However, the same code running on the same machine under IIS fails.

    When I had problems accessing some files on local machine from my
    ASP.NET application before , I simply assigned ASPNET user to those
    directories , and it worked fine .

    However, since the files that should be accessed in the dll are
    located on different machine, I can not do this .
    I believe this is something to do with permissions.
    It looks like I need to use ASP.NET impersonation. Is that right ? Is
    there any good totorial explaining ALL steps that should be done ?
    I found out that I need to add the “identity” line in my Web.Config .
    I did it as following , but it didn’t help :
    <identity impersonate="true" userName="my user name" password="the
    user password"/>

    My questions are :

    What should I do in addition to writing this “identity" line in
    Web.Config ?
    I use FORMS ASP.NET authentication . Is that OK ?
    What IIS Authentication should I use? Where I define it ?
    If I use impersonation, what user name should I use? Where it should
    be configured and what roles / permissions it should have?
    Should it be domain user? Local User?
    What config files should I change ( Web.Config , Machine.config ?
    Something elase ? )

    Any advices would be appreciated !!!!

    Thanks , Orit .
    Orit, Aug 8, 2008
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page