Re: Can't determine if a file exists
From: Nikolai Evseev (NikolaiEvseev_at_discussions.microsoft.com)
Date: Mon, 15 Aug 2005 01:53:01 -0700
Nicole, this is running on my machine just for the time being. Eventually
it'll end up on another IIS server. But the problem is, that the shared
folder will still stay in the same place - on a pc which is not a member of
the domain. So the authentication problem will still exist.
"Nicole Calinoiu" wrote:
> In addition to what Paul's already mentioned, you might also want to
> consider the relative importance of this "not on the domain" scenario. I'm
> guessing that this is running on your machine at present because it's still
> in development, but that it's probably eventually intended to run on another
> machine. If so, and that target machine is on the domain, perhaps you
> should set up a test server that is on the domain so that you can
> concentrate on testing and troubleshooting that scenario instead...
> "Nikolai Evseev" <NikolaiEvseev@discussions.microsoft.com> wrote in message
> > Thanks Nicole for your reply,
> > The target shared folder (call it \\PCWKG\SHAREDFOLDER) is on another
> > machine. My machine (PCDOM1), on which I am running the browser is also
> > the
> > IIS. Presume that PCDOM1 is in the corporate domain, and PCWKG is in it's
> > own
> > workgroup and not in the corporate domain. If IIS\website authentication
> > is
> > set to Windows Authentication then it works, if Anonymous then not. But if
> > I
> > login as myself (with the same user name and password) on PCDOM2 and start
> > the browser on it then it's not working as well. I was thinking that the
> > reasong could be that my own account doesn't have access to the shared
> > folder, but how can I give access on a shared folder to the domain user if
> > the PCWKG is not on the domain?
> > "Nicole Calinoiu" wrote:
> >> "Nikolai Evseev" <NikolaiEvseev@discussions.microsoft.com> wrote in
> >> message
> >> news:47F77CB0-98A8-4497-8EB3-CA3E5BB128D5@microsoft.com...
> >> > Hi there,
> >> >
> >> > I am usign System.IO.File.Exists in my ASP.NET code to determine if a
> >> > file
> >> > exists in the specified location. The webserver is my local machine,
> >> > which
> >> > is
> >> > a part of the corporate domain. The file the existence of which I am
> >> > trying
> >> > to determine is sitting in the shared folder of the PC which is not a
> >> > part
> >> > of
> >> > the corporate domain. If the Authenitcation on my webserver allows
> >> > Anonymous
> >> > user to logon then Exists method returns false (I take it happens
> >> > because
> >> > my
> >> > anonymous user doesn't have access to that shared folder, since it's
> >> > not a
> >> > part of the domain).
> >> Since ASP.NET is supposedly running on the same machine as the target
> >> folder, the domain issue shouldn't be relevant for the anonymous
> >> scenario.
> >> Are you using a local path to attempt to access the file (e.g.:
> >> "c:\somefolder\somefile.txt" instead of
> >> \\yourmachine\sharename\somefile.txt)? If so, you'll need to grant at
> >> least
> >> the "List Folder/Read Data" permission on the folder containing the file
> >> to
> >> the user account under which your application is running. (If you
> >> haven't
> >> fiddled with the ASP.NET process account or impersonation settings, this
> >> will be the ASPNET user on Windows XP when the application is using
> >> anonymous access.) If you're not using a local path, try switching to
> >> that
> >> instead.
> >> > If I am using windows authentication then everything
> >> > works fine, and I am able to see if the file exists in the shared
> >> > folder.
> >> Presumably because your account has permissions to the file.
> >> > The
> >> > last one, though, only works if I open the browser on the same PC where
> >> > my
> >> > webserver is running. But if I am logged on using the same user name
> >> > and
> >> > password on another PC then again Exists method always returns false.
> >> Hmm... Now I'm starting to wonder if the "shared folder" is really local
> >> to
> >> your PC or not. Could you please confirm if it's truly local to your PC
> >> or
> >> if it's actually pointing to a share on another machine?
> >> > I know it's a little confusing but still hoping that you can help me
> >> > solving
> >> > this problem
> >> >
> >> > Thanks