I have an ASP.NET application running over a shared .NET server. I want to allow the current logged user to create a folder into a specific path when the application needs it. So, I'm just checking the following:
var userFolderPath = Path.Combine(Server.MapPath("~/storedphotos"), username);
if (!Directory.Exists(userFolderPath)) {
Directory.Create(userFolderPath);
}
When I run this code into my local machine it works perfectly. However, when I publish the application to that server and try to do the same, it's returning me:
"Access to the path 'xxxxxx' is denied."
I think it could be a permission issue. Once I cannot change anything at the IIS into the server or any configuration, is there a way to let the user is using my application to create the folder without problems?
try this:
As Error says You need to assign Permissions to Folders
IIS_IUSRS
(Full Control)Full Control
in allowNote: If Above things are not working then try to give same permission to
NETWORK
,NETWORK SERVICE
Users