Last post Jan 28, 2019 07:44 AM by Wei Zhang
Jan 25, 2019 06:46 AM|JagjitSingh|LINK
When i give below code and want to save on iis server it is working
string Path = Server.MapPath("~/Upload/");
No i want to save on file on another computer on which folder is shared wit name Test . When i write below code it gives this error
string Path = "//192.168.1.90/Test/";
Access to the path '\\192.168.1.90\Test\Im.txt' is denied.
When i runs \\192.168.1.90\Users folder opens
Jan 25, 2019 12:20 PM|PatriceSc|LINK
Llikely because your own account is allowed to access this network share but not yet the account under which your web application runs.
You have mutiple ways to handle that. With the default configuration, the app uses "ApplicationPoolIdentity" (which is special local account for your web site) and is seen as domainname>\<machinename>$ when accessing network ressources (so you would need
to give access to this account but it means also that all web apps on this server are now able to access thos netwrok share).
See https://docs.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities#accessing-the-network for details.
My personal preference is to use a separate dedicated domain\name account for each app (but rry first maybe with the basic config before going further).
Jan 28, 2019 07:44 AM|Wei Zhang|LINK
According to your description, firstly you have to make sure that the folder give the permission for iis to write , you could follow the link as below:
1.Right Click Folder
2.Go to Security Tab
3.Click on Edit
4.Click on Add
5.Click on Addvance
7.Give Permission to IIS_IUSRS (Full Control)
8.Click On OK
9.Click On OK
10.Click On Full Control in allow
11.Click On OK
Again Run the Application
I hope it could help you.