remote file access in .net app

Discussion in 'ASP .Net' started by Amie, Mar 2, 2006.

  1. Amie

    Amie Guest

    Hi,

    My .NET application has a script that checks whether an image file on a
    remote server exists using File.Exists.

    >From my localhost (Server A), I can access the image file via network

    path (\\servername\foldername\image.jpg) or virtual directory
    (../foldername/image.jpg) within my application.

    When I moved the app to a test server (Server B), it still works fine.

    However, when the same codebase is run on a pilot server (Server C), it
    somehow returns false when File.Exists() is executed. Same target, same
    code.

    Server A, B, and C are all Windows 2003 and the remote server is
    Windows 2000. The target directory has Everyone to have full
    permission.

    What factors can affect file access on a remote server? I tried playing
    with IIS, file system, etc but couldn't figure out.

    Let me know if any of you has any suggestion.

    Thanks in advance!
     
    Amie, Mar 2, 2006
    #1
    1. Advertising

  2. Amie

    Kevin Frey Guest

    I assume \\servername is different to Server A, Server B, and Server C?

    As a guess I would examine whether ASP.NET is running under the same user
    account of each machine. On our Windows 2003 server I think ASP.NET runs
    under the "NETWORK SERVICE" account and I'm not sure whether this can cross
    network boundaries at all.

    Secondly, you are using a network share \\servername\\foldername to access
    the resource. What permissions have been assigned to the network share? I
    have found this to be a common gotcha.

    Kevin.

    "Amie" <> wrote in message
    news:...
    > Hi,
    >
    > My .NET application has a script that checks whether an image file on a
    > remote server exists using File.Exists.
    >
    >>From my localhost (Server A), I can access the image file via network

    > path (\\servername\foldername\image.jpg) or virtual directory
    > (../foldername/image.jpg) within my application.
    >
    > When I moved the app to a test server (Server B), it still works fine.
    >
    > However, when the same codebase is run on a pilot server (Server C), it
    > somehow returns false when File.Exists() is executed. Same target, same
    > code.
    >
    > Server A, B, and C are all Windows 2003 and the remote server is
    > Windows 2000. The target directory has Everyone to have full
    > permission.
    >
    > What factors can affect file access on a remote server? I tried playing
    > with IIS, file system, etc but couldn't figure out.
    >
    > Let me know if any of you has any suggestion.
    >
    > Thanks in advance!
    >
     
    Kevin Frey, Mar 2, 2006
    #2
    1. Advertising

  3. Amie

    Amie Guest

    Hi Kevin,

    Thanks for the reply.

    Yes, Server A, B, and C are web servers the app is running, and the
    target server has images files. Sorry if I wasn't clear previously.

    As I specified, "Everyone" has full access to the directory (intranet
    network), so figured it wouldn't be necessary to add NETWORK SERVICE--
    and they are on different boxes after all. I thought about adding
    IUSR_[ServerCMachineName] in the target directory, but shouldn't
    "Everyone" cover it all?

    Very puzzling thing is it does work from two servers (my localhost and
    test server), but just not from our pilot server.. There's gotta be
    something different but can't figure out what. [sigh]

    If you can think of anything at all, please let me know..! Thank you
    again.

    Amie
     
    Amie, Mar 2, 2006
    #3
  4. Amie

    Amie Guest

    It turns out it had to do with IIS setting. The web server that did not
    have access to the remote directory was running in IIS 5 isolation
    mode. After making it run in IIS 6 native mode, it worked fine.
     
    Amie, Mar 8, 2006
    #4
    1. Advertising

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.
Similar Threads
  1. Jordan Marton
    Replies:
    0
    Views:
    430
    Jordan Marton
    Jul 28, 2003
  2. Jordan Marton
    Replies:
    0
    Views:
    341
    Jordan Marton
    Jul 29, 2003
  3. JonnyD
    Replies:
    16
    Views:
    764
    Paul Clement
    Oct 31, 2005
  4. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Can't access remote Sql Server from my web app

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, May 31, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    448
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
    May 31, 2006
  5. Amie

    remote file access in .net app

    Amie, Mar 2, 2006, in forum: ASP General
    Replies:
    1
    Views:
    107
Loading...

Share This Page