Reputation: 3305
Currently I am working on asp.net website and I am not very much familiar with asp.net. I have a WebForm
and when user clicks on Submit button a .txt
file should be get created on server(Text File name is ID entered by user which is unique.)
I used following to create the file.
File.Create( Server.MapPath("~") + id + @".txt");
But this gives me error when the site is running on the localhost of my pc.
Access to the path 'C:\inetpub\wwwroot\XXX\YYY.txt' is denied.
This is something related with access permission. What should I do to fix this. Please advice me.
Upvotes: 0
Views: 3109
Reputation: 15253
Add write permission for NETWORK SERVICE to the folder in question.
Upvotes: 2