khurshed_nosirov
khurshed_nosirov

Reputation: 248

How to grant access to all subfolders of a folder in asp.net

Let's assume I've got multi-user asp.net web application. There are 2 roles - admin and user. The users of application belong to different organizations. There is a folder with path "~/Reports" with below config file in it:

<system.web>
    <authorization>
        <allow roles="*"/>
    </authorization>
</system.web>

In addition folder "Reports" has many subfolders in it, each corresponding to an organization. For example "~/Reports/Organization1" It is supposed that all the users with role "user" will upload their report files to subfolder in "~/Report" corresponding to their organization.

I've implemented the logic in code behind, but now I'm facing with an error like "Access denied for path ..Reports/Organization1" when the user of an Organization1 attempts to upload a file.

Is there any way to change config file above(in Reports) so that users get access to all the subfolders of "~/Reports"?

I would appreciate any help!

Upvotes: 0

Views: 1529

Answers (1)

Hossam Barakat
Hossam Barakat

Reputation: 1397

What you need to do is give the asp.net worker process write permission to the reports folder and this has nothing to do with the web config

You can find the steps in the following answer https://stackoverflow.com/a/14654062/499930

Upvotes: 1

Related Questions