Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.

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....

below is my simple code.


What I have tried:

Dim fp As String = "\\Server101\Country\Projects"    '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()
Posted
Updated 31-Jan-19 22:31pm

1 solution

IIS does not run under a user account, it normally runs under the Network Service account (though that can be changed in the IIS configuration).

Unless that account is given access, or a specific user used to access the file server, you will get this error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900