Main Topics
Browse All TopicsI am developing a web app for our company intranet. C# and ASP.NET
I am tring to upload a file to the server. The same server that is hosting the web app.
I am getting an unauthorized access error when I try to do the upload.
How can I go about giving users access to upload files to the server?
The server is right next to me and I have administrator access .... I just don't know where to go / what to do.
Thank you,
Tom
ERROR DETAILS:
Server Error in '/' Application.
--------------------------
Access to the path 'C:\MMMMMMMMMMLLLLLLLLLLLL
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.UnauthorizedAccessE
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:
Line 20: {
Line 21: string filename = FileUploadLeads.FileName;
Line 22: FileUploadLeads.SaveAs("C:
Line 23:
Line 24: if (FileUploadEvent != null)
Source File: c:\Inetpub\crm\crmcustomco
Stack Trace:
[UnauthorizedAccessExcepti
System.IO.__Error.WinIOErr
System.IO.FileStream.Init(
System.IO.FileStream..ctor
System.IO.FileStream..ctor
System.Web.HttpPostedFile.
System.Web.UI.WebControls.
crmcustomcontrols_UploadLe
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Page.RaisePo
System.Web.UI.Page.RaisePo
System.Web.UI.Page.Process
--------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: tankergoblinPosted on 2009-11-06 at 17:48:49ID: 25764598
you mean the web server is next to you.
if is your own server, then look for the drive that you use to install the web server and copy paste the file to wwwroot.