I am trying to create new directory and placed some files in that folder.
creating folder and saving the file in "File Server" (seperate file server). Ex : \\Server101\Country\Projects.
"We are maintaining Application in one server (i.e. Application Server) and Folder creation in another server (i.e. File Server)"
When we trying to create a folder in the above path, it's showing "Access denied" error.
Error : Access to the path '\\Server101\Country\Projects' is denied.
The file server path has already given read/write access for those who are all creating folder through ASP.net application.
How to handle this problem.
below is my simple code.
Dim fp As String = "\\Server101\Country\Project" 'File Server path (another server)
If (Not System.IO.Directory.Exists(fp)) Then
System.IO.Directory.CreateDirectory(fp)
End If
File.Create(fpath & "\test.txt").Dispose()
Almost i have given all the settings in IIS Application folder and File Server folder.
Could you please tell us which operation you have done ? And do you find out from the application pool for the website what is the identity it is running under and grant correct permission ?
Member
209 Points
701 Posts
Access path denied when creating new folder in file server.
Jan 31, 2019 12:57 PM|gani7787|LINK
I am trying to create new directory and placed some files in that folder.
creating folder and saving the file in "File Server" (seperate file server). Ex : \\Server101\Country\Projects.
"We are maintaining Application in one server (i.e. Application Server) and Folder creation in another server (i.e. File Server)"
When we trying to create a folder in the above path, it's showing "Access denied" error.
Error : Access to the path '\\Server101\Country\Projects' is denied.
The file server path has already given read/write access for those who are all creating folder through ASP.net application.
How to handle this problem.
below is my simple code.
All-Star
48570 Points
18081 Posts
Re: Access path denied when creating new folder in file server.
Jan 31, 2019 01:22 PM|PatriceSc|LINK
Hi,
With the default configuration the code runs under the account configured for the web application (not under the account of each authenticated user) and it's this account that should be granted access. See https://docs.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities#securing-resources
And/or you may also have a typo. I noticed you are have "Projects" when describing what happens but your code uses "Project".
Member
209 Points
701 Posts
Re: Access path denied when creating new folder in file server.
Jan 31, 2019 01:46 PM|gani7787|LINK
Sorry.
it is "projects" only.
Dim fp As String = "\\Server101\Country\Projects"
The same code works in local system. It means the code will create folder and text file in file server.
But, while running from the server through IIS, it isays "Access path denied Error"
Almost i have given all the settings in IIS Application folder and File Server folder.
Still getting problem...How to identify the error....
All-Star
18815 Points
3831 Posts
Re: Access path denied when creating new folder in file server.
Feb 01, 2019 02:43 AM|Nan Yu|LINK
Hi gani7787,
Could you please tell us which operation you have done ? And do you find out from the application pool for the website what is the identity it is running under and grant correct permission ?
Best Regards,
Nan Yu
Member
209 Points
701 Posts
Re: Access path denied when creating new folder in file server.
Feb 01, 2019 04:36 AM|gani7787|LINK
pls. find screenshot below for your reference (screenshot attached in the below link.
https://1drv.ms/f/s!AiSRcgO5FUmNgQVuMTLx2R6alYEk
Note : i'm using IIS 7.5