I am trying to create a CSV file using the C# code below:
string filename = "ChargingDetails_" + Convert.ToDateTime(dateTimeNow).ToString("MMddyyyy_HHmmss") + ".csv";
FileStream fs = File.Create(Server.MapPath("~/" + filename));
It works correctly when I tried locally but when I tried it on development server it is giving me the error that “Access is denied for the path”.
Can anyone help me with this issue? Is this is permissions related issue? because I am able to create file locally in my pc but when i tried to make it work from the server it is giving me the access denied error.
Please help me solve the issue. If possible please provide any sample code or URLs for the help.
Thanks in advance….
You have to give write permission to IIS user account