I have a .NET page built with c#. This page creates a temporary report and then creates a pdf file. Then this file is sent to users via email. After the email is sent out i have written a code to delete the temporary file. My problem is i am getting a accessed denied exception.
Exception Details: System.Unauthor izedAccessExcep tion: Access to the path 'c:\Inetpub\vho sts\***\***\*** *\10836.pdf' is denied.
here is the code that checks for the file and then performs the delete.
I have set full permission on IIS for IO purpose. I am sure this error is due to permission issue. Any advice will be greatly appretiated. Thank you in advance.
Exception Details: System.Unauthor izedAccessExcep tion: Access to the path 'c:\Inetpub\vho sts\***\***\*** *\10836.pdf' is denied.
here is the code that checks for the file and then performs the delete.
Code:
string file = HttpContext.Current.Server.MapPath("../***/" + fileid + ".pdf"); if (File.Exists(file)) { File.Delete(file); }
Comment