0
votes

I created IIS website with following setting (ApplicationPool account is named Fitko)

enter image description here

When I run website and submit form with image, application throw an error

UnauthorizedAccessException: Access to the path 'C:\IISWorkspace\Fitko\upload\instructors' is denied. System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)

I gave full permissions to Fitko folder to these accounts

  • IUSR
  • Users
  • Administrators
  • network service
  • IIS AppPool\Fitko

yet still the UnauthorizedAccessException exception still throwing.

How can I give access permissions to IIS to write to the folder ?

2

2 Answers

1
votes

I solve the issue by enabling windows authentication (I had Anonymous Authentication before, but probably it can be enabled together)

enter image description here

the setting is in

Web Project > Properties > Debug > Web Server Settings

and the flag seems to takes control even when the publish configuration is set to release.

0
votes

In my opinion, the issue typically indicates a permission error of the specific folder. What is your Application pool identity? try to right-click the folder and grant Everyone Account full access to the folder.
enter image description here
Besides, under certain cases, this might relate to our website framework technology. https://github.com/stryker-mutator/stryker-net/issues/272
Feel free to let me know if the problem still exists.