image uploading exception(Access Denied)

Hi all,
my Environment is windows server2008,ms.net3.5,sqlserver2005,IIS7.0.
So i Publish and Deployed my web application in IIS. when i trying to upload images its giving exception.In table datatype is nvarchar(50).
exception follows :Server Error in '/sathvika' Application.
Access to the path 'C:inetpubwwwrootsathvikaWallpapers7Jayeebhava-wp.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:inetpubwwwrootsathvikaWallpapers7Jayeebhava-wp.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 , 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.

So please try to resolve my issue


  • You need to set a 'Write' permission to the folder the image is uploaded to. You can do this using IIS (Internet Information Services) (to open IIS right click on 'My Computer' then 'Manage') by selecting the folder and then opening the 'Action' menu then 'Permissions' then check the 'Write' permission for all the users.
    Good luck.
    Sharbell K. Mouess
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion