ASP.net Getting the error "Access to the path is denied." while trying to upload files to my Windows Server 2008 R2 Web server

Hassan Mokdad picture Hassan Mokdad · Nov 1, 2013 · Viewed 162.5k times · Source

I have an asp.net webapplication that uploads files to a specific folder on the Web server. locally everything works fine, but when I deploy the application to the Webserver, I begin getting the error "Access to the path "D:\Attachments\myfile.doc" is denied". I gave the "IIS AppPool" user that the application is running under full permission on the folder. I even gave "Everyone" full permissions, but with the same error.

I added the folder to the Exceptions list of the Antivirus, but with the same result. I am begining to suspect that maybe Windows Server 2008 R2 needs a trick for my upload to work. I really appreciate your help.

Thanks

Answer

UMAR-MOBITSOLUTIONS picture UMAR-MOBITSOLUTIONS · Feb 1, 2014

Right click on your folder on your server or local machine and give full permissions to

IIS_IUSRS

that's it.