Access denied for uploading file

Posted by Vanchi050585 under ASP.NET on 11/30/2010 | Points: 10 | Views : 6385 | Status : [Member] | Replies : 2
hi all,

when i am uploading the file through the website the following error will occured:
Server Error in '/' Application.
Access to the path 'C:\inetpub\vhosts\zaika.co.in\httpdocs\Srch\UploadFiles\24_Balaji333.jpg' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\inetpub\vhosts\zaika.co.in\httpdocs\Srch\UploadFiles\24_Balaji333.jpg' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

pls help me. urgent..

Thanks
tvn



Responses

Posted by: Raja on: 11/30/2010 [Member] Starter | Points: 25

Up
0
Down
The answer is written in the exception you have got.

Right click your "UploadFiles" folder and go to security tab and allow full permission (modify, write, read) permission to the user who is trying to user the asp.net app (this might be the aspnet_xxx user or the system login username or the ftp name).

This error is related with the folder permission, make sure that the folder where you are trying to upload the file has full permission (read, write) and you will not get this error.

Thanks

Regards,
Raja, USA

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kishanthakur on: 6/2/2012 [Member] Starter | Points: 25

Up
0
Down
hiii raja your blog help me
thank you very much


Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response