[2005] Problem with paths
Hello,
I'm having trouble streamreading a text file located on a network drive.
If I run the code in VWD2005, everything is ok.
If I run the code in I.E., or IIS, it has the following problems:
Path = K:\Text\File.txt
It can't find this file
Path = \\Server\Share\Text\File.txt
The user name or password is invalid
I then thought that I'd try creating a batch file that could copy the file from the network drive, to somewhere local, and read the file from there. In VWD, it copies the file, and reads the file from the local drive, but in IE or IIS, it doesn't even bother running the .bat file.
I imagine that this all quite correct, and ensures security when viewing a page on the web, but this is for internal use only, so I need the users to be able to read a text file, irrespective of whether its on the local drive, or network drive.
Re: [2005] Problem with paths
When a web site is running under IIS it uses a local account named ASPNET or Network Services depending on the OS. In IIS you could also configure the site to "run as" a specific user.
Whichever account you use, it needs permissions to access network resources.
Re: [2005] Problem with paths
Quote:
In IIS you could also configure the site to "run as" a specific user.
Thanks for your reply. I actually managed to do what I needed to do by writing a file system watcher utility to watch for changes to the file I need to work with, and copy it to where ASP.NET could read it.
However, could you point me in the right direction with regards to your comment?
Re: [2005] Problem with paths
If you set identity impersonate="true", then your ASP.NET application impersonates the user of the application assuming you're using Windows Authentication rather than basic/anonymous.