use IIS 7 Manager to set permissions

2019-08-29 09:40发布

问题:

I followed the steps in here but do not know how to setup permissions, i need to create a directory and unzip a zip file into it and get access denied on the CreateDirectory line:

string zipCurFile = model.ScormPackageFile.FileName;
string destinationDirectoryName = Path.GetFileNameWithoutExtension(zipCurFile);
Directory.CreateDirectory(destinationDirectoryName);

How to add ASP.NET 4.0 as Application Pool on IIS 7, Windows 7

here my IIS 7 manager page

please help?

回答1:

You need to give modify permissions for the parent directory to the app pool identity user. This is something that you would do through Windows Explorer and not through IIS Manager.

Right-click the target directory and choose Properties > Security. Edit the permissions for that directory, add the user that your application pool is using and give that user Modify permissions to that folder.

Assuming that you are creating the directory C:\Files\ZipTarget\Scorm and the C:\Files\ZipTarget directory already exists, you will need to give the app pool identity user Modify permission to the C:\Files\ZipTarget directory.