locked
How to set up permission for the folder for web application? RRS feed

  • Question

  • User546194788 posted

    I used code below to save PDF file into a folder. It works fine when running in local PC (Did not use local IIS but file system).

    Once published app to the web server, PDF file can't be saved and saying that "Access denied".

    How to set up permission for the folder for web application?

    Dim sFileName As String = "\\server_order\Order\20180820order.pdf"

    Dim rpt As New ReportDocument

    rpt.ExportToDisk(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat, sFileName) 

    Thursday, August 30, 2018 7:41 PM

All replies

  • User1120430333 posted

    All ASP.NET Web programs run under the context of the WPW3.exe that services the Application Pool that is hosting the Web program. WPW3.exe will present the credentials to be used as set by the Application Pool Identity. The WPW3.exe presents App Pool Identity/the credentials  on the behalf of the Web program, which must be on the resource the program is trying to access..

    https://stackify.com/w3wp-exe-iis-worker-process/

     

    Friday, August 31, 2018 6:56 AM
  • User-893317190 posted

    Hi aspfun,

    What do you mean by "Did not use local IIS but file system"? Do you mean you publish your app through folder and folder share just as the picture shows below?

    If so , about your problem , you could try to modify the permission of your application pool. Please refer to

    https://docs.microsoft.com/en-us/iis/manage/configuring-security/application-pool-identities

    Best regards,

    Ackerly Xu

    Friday, August 31, 2018 9:42 AM
  • User546194788 posted

    Q: What do you mean by "Did not use local IIS but file system"? 

    A: From local PC, I open project from "File System" not from "Local IIS" but web server is from server IIS.

    Friday, August 31, 2018 11:07 AM
  • User1120430333 posted

    Q: What do you mean by "Did not use local IIS but file system"? 

    A: From local PC, I open project from "File System" not from "Local IIS" but web server is from server IIS.

    Well, if you had done this with local IIS  using VS, which is the same as the IIS server you deployed to, then you would have encountered the issue before you deployed the program and discovered there is an issue. 

    Friday, August 31, 2018 7:03 PM
  • User-1320437544 posted
    Hello, thats quite easy if you have access to the deployment server just navigate to the folder you want to set the write permissions. After that right click on the folder and select properties-security and under the active users make sure the IUSR has write permission in the checkbox checked.

    Thats the default application pool user for IIS and you need to grand write permissions so you can modify any content in this folder.

    And in case use are using third party hosting services you need to do the same thing except you will have to set the permission from some sort of control panel, where the steps to take are quite different between each control panel. Just ask the support for help or digin their knowledge base.

    Saludos
    Saturday, September 1, 2018 9:38 PM
  • User932909087 posted

    Hi aspfun,

    From the error message, it is permission issue. Have you test to give full permission to your folder?

    Tuesday, September 4, 2018 8:43 AM
  • User-943250815 posted

    Following DA924, all you have to do, is give permissions to "Application Pool User" to write permission on folder nothing more than this.
    Dont´t know which Application Pool User you using, but if it is DefaultAppPool you can give folder write permission to "IIS APPPOOL\DefaultAppPool".

    If not  give write permissions on folder to "IIS APPPOOL\<whatever name you use for application pool>"

    Wednesday, September 5, 2018 1:29 AM