Click here to Skip to main content
15,790,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all, I have a web page which allows only logged in users to write to a file on the server. When I try to write to a file on the server by clicking the Save button, I get the following error
Access to the path 'G:\PleskVhosts\\httpdocs\images\Five.png' is denied.

The error message also said the following
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity.

I am using Form authentication and I've tried to implement impersonation but it did not work. Can anyone please tell me how to grant access to resources on the server, thanks in advance.

Provide full Access of folder as well as files .
go your FTP Control Panel and change folder/Directory Permission .
otherwise you share your problem with service provider And say give me file Permission for save in a folder .
Share this answer
provide full access on that folder for login user of window.
Share this answer
First of all don't use any random drive in server as in future you may not have access to that. So use user specific path on the server which would never throw an error.

Use below code for any kind of manipulation of files.
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

Always use this path for saving and accessing files.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900