Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : .NET : ASP.NET : (PLEASE HELP) Error While Using this code in ASP.Net (File Uploading) Signup · Login
Author Thread
(PLEASE HELP) Error While Using this code in ASP.Net (File Uploading)
Posted in tutorial: File Uploading in ASP.NET Using C#
·  amit78mail
User
Joined: 14 Feb 2005
Total Posts: 2
(PLEASE HELP) Error While Using this code in ASP.Net (File Uploading)
Posted: 14 Feb 2005
Respected Sir,
First i like to thank you for this code as it helped me a lot, teaches me new things.
I downloaded the code in zip file. File Upload.aspx and pasted that code in another webform, all goes well when i run this prog.It selects the file from the system when Browse button clicked, but when Upload button is clicked it shows error.

The error is::
Exception Details: System.UnauthorizedAccessException: Access to the path "c:\inetpub\wwwroot\UPLOADINGIMG\check.txt" is denied.

The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.

To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.

Source Error:


Line 21: else
Line 22: {
Line 23: File1.PostedFile.SaveAs(Server.MapPath(".//"+ StrFileName));
Line 24: Response.Write( "<font color='green' size='2'>Your file " + StrFileName + " of type " + StrFileType + " and size " + IntFileSize.ToString() + " bytes was uploaded successfully</font>");

I didn't understand , how to do solve this problem.

** I am making an application in ASP.Net using C# in which a user who logged in can upload his/her image and using MS-Acess as backend . Please tell me what other necessary things i have to do to perform this functionality.
Kindly response as early as possible PLEASE.

Hope You will help me solving this problem.
·  kirands
User
Joined: 19 Jan 2007
Total Posts: 1
solution
Posted: 19 Jan 2007
put tag <authentication mode="Windows" />

in Web.config

Users Who Have Visited This Thread In Last 24 Hours
3 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.