Writing to a file NOT on web server
-
I am having trouble getting an aspx web form to write to a UNC path. I need to upload a file then write the file to a location not on the web server the file was uploaded to. Is this at all possible? If yes, How?
ASP.NET applications run in their own restricted account, that doesn't have very much permission to do anything except run the web site. You need to give permission to this account to write to the disk. If you need to write across a network, it may be possible to select a domain account (ASP.NET normally runs on a machine account) so that permissions can be set elsewhere on your network. You'll find the settings in IIS in the directory security tab of the properties dialog for the virtual directory. However I've never tried this so I'm not 100% certain whether it would work or not.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871)
-
ASP.NET applications run in their own restricted account, that doesn't have very much permission to do anything except run the web site. You need to give permission to this account to write to the disk. If you need to write across a network, it may be possible to select a domain account (ASP.NET normally runs on a machine account) so that permissions can be set elsewhere on your network. You'll find the settings in IIS in the directory security tab of the properties dialog for the virtual directory. However I've never tried this so I'm not 100% certain whether it would work or not.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar "On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." --Charles Babbage (1791-1871)
We are unfortunately requiring Windows Authentication to access the website. If we change to allow anonymous access and use a domain account, would it be possible to get the user's domain account so authentication and authorization can occur through .NET.