I get this error anytime I try to upload a file in my ASP.NET MVC application. Can anyone help me out. The error thrown is a System.UnauthorizedAccessException
Access to the path
‘C:\inetpub\wwwroot\IBGTxalert\TxAlert\TxAlert.Web\Files\linqtoexcel.xlsx’
is denied.
You need to set file access permission to
Network Serviceaccount.C:\inetpub\wwwroot\IBGTxalert\TxAlert\TxAlert.Web\Files).Service account is not listed, add it.
and in the Permissions for NETWORK SERVICE section, select the Read,
Write, and Modify permissions. Click Apply, and then click OK.
Steps taken from msdn