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.