Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 24, 2013 07:54 AM by Pengzhen Song - MSFT
Jan 23, 2013 12:49 PM|LINK
I have an asp.net application, hosted by iis in c:\inetpub\wwwroot\myApp
I try to programmatically give my application rights to write uploaded files to c:\inetpub\wwwroot\myApp\app_data\upload
I did that by following method:
DirectoryInfo dInfo = new DirectoryInfo(path);
DirectorySecurity dSec = dInfo.GetAccessControl();
dSec.AddAccessRule(new FileSystemAccessRule( "IIS APPPOOL\\myApplicationPool" , fileSystemRights.FullControl, accessControlType.allow));
Now if I rightclick the folder, and select properties/security, myApplicationPool is appeared there with only "special permissions" allowed. And when I try to upload something it will give me an unauthorizedexception..
What is the proper way to give the write rights to this folder?
I tested on Win8/IIS8/IE10
Jan 24, 2013 07:54 AM|LINK
In my opinion, this way is impossible. Maybe you should manually set the permission througth web.config or iis.
Please refer this
Hope it can help you.