locked
Save file Error RRS feed

  • Question

  • User-1499457942 posted

    Hi

      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

    Thanks

    Friday, January 25, 2019 6:46 AM

Answers

  • User-1174608757 posted

    Hi JagjitSingh,

    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
    6.Find Now
    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.

    Best Regards

    Wei Zhang

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 28, 2019 7:44 AM

All replies

  • User753101303 posted

    Hi,

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

    Friday, January 25, 2019 12:20 PM
  • User-1174608757 posted

    Hi JagjitSingh,

    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
    6.Find Now
    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.

    Best Regards

    Wei Zhang

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 28, 2019 7:44 AM