-1

when I upload file before publish the project it run right but when publish the project when i upload the file display this error: Access to the path 'C:\inetpub\sites\Khadamatresan\Contents\9164d9fe-d515-47e5-bbf2-95a56219e5c9.png' is denied.

how to fix it? Thank you in advance

Alejandro1991
  • 119
  • 1
  • 13
  • Please click on below link for better help: https://stackoverflow.com/questions/5729264/what-are-all-the-user-accounts-for-iis-asp-net-and-how-do-they-differ – Rohit kalyanpuri Apr 10 '19 at 13:28

2 Answers2

1

Go to the folder in question and look at the permissions on the folder. My answer is that it only has administrator permissions against it and what you are sending via code doesn't not replicate them permissions.

JamesS
  • 2,167
  • 1
  • 11
  • 29
1

I suggest you could try to modify the C:\inetpub\sites\Khadamatresan\Contents folder's permission to allow IUSR and IIS/yourapplicationpoolname to read and write file.

More details, you could refer to below steps:

1.Make sure you use the application pool advanced setting's identity is applicationpoolidentity

enter image description here

2.Right click the C:\inetpub\sites\Khadamatresan\Contents folder and select property.

3.Click the scruity and edit button.

enter image description here

4.If IUSR and your application pool name doesn't show in the window. I suggest you could
Click the add button and type in IUSR and IIS AppPool\.

enter image description here

enter image description here

5.Modify the permission to enable the full control

enter image description here

Brando Zhang
  • 22,586
  • 6
  • 37
  • 65