Hi,
I'm experiencing a bit of a problem with security and file access from
within a ASP.Net application...
Locally (from an XP client) I manage to get any file or folder on my
machine with something similar to this:
DirectoryInfo di = new DirectoryInfo(strURL);
if(di.Exists)
{
FileInfo[] fileList = di.GetFiles();
//DirectoryInfo[] dirList = di.GetDirectories();
strDocURL = fileList[0].FullName;
Response.Redirect(strDocURL);
}
However when trying to access a network file/folder I get a security
exception and di.Exists is false. (System.UnauthorizedAccessException:
Access to the path "\\share\folder" is denied.)
The same code running from one of our W2K servers is able to open
network files just by having changed the following:
Response.Redirect("file:" + strDocURL);
However it isn't able to open folders (even without the "file:" bit).
I have set <identity impersonate="true" /> in the Web.config file.
-1 How can I keep the user credentials through out the application?
-2 Is there an alternative way to Response.Redirect for opening a
file/folder from within a browser?
Thanks
Rosa