Paul
Paul

Reputation: 1006

ASP.NET permissions issues

Im using Windows Server 2008, IIS7, .NET 4 and when I use the FileUpload control to save a file to a directory I get :

Access to the path 'C:\xxx\Websites\CMS\Admin\test' is denied.

I have given the test folder full control permissions for NETWORK SERVICE but it makes no difference.

I have given full control to the Everyone user but makes no difference.

It might have something to do with the fact that up in the CMS folder there is a MVC web application and in the CMS\Admin folder there is a web forms web application. It is the web forms web application that is trying to upload the file and getting the permissions error.

Can anyone offer a suggestion.

Upvotes: 0

Views: 104

Answers (2)

derek
derek

Reputation: 4886

Check the Application Pool that your site is running under and make sure that it is running as NetworkService instead of PoolIdentity.

Upvotes: 0

womp
womp

Reputation: 116977

Are you running your application in Medium Trust? Medium Trust does not allow file IO outside of it's own virtual path hierarchy.

Check the web.config for a <trust level="Medium" ... element.

Upvotes: 2

Related Questions