| | |
Uploading files Access Denied Error
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
Hi all,
I am very happpy to return back again to you.
This time i have a critical problem about uploading files on the server by asp.net.
I choosed the HTML control "File" and Make it run as server control , and got its file name by the statement
string fname=File1.PostedFile.FileName
then i want to save it on the server Hard Disk so i used the statement :
try
{
File1.PostedFile.SaveAs(Server.MapPath("Project\\"+ff));
}
catch
{
Directory.CreateDirectory(Server.MapPath("Project\\"+ff));
File1.PostedFile.SaveAs(Server.MapPath("Project\\"+ff));
}
When running the page the following exception occured
Access to the path "c:\inetpub\wwwroot\Cubicle\Project\MyFile.doc" is denied.
which "c:\inetpub\wwwroot\Cubicle\" is my project directory (my project name is Cubicle)
Note : i configured the IIS options to be write ,read, and Directory browsing . and the problem is still exist .
Can any one help me ?
Thank You.
I am very happpy to return back again to you.
This time i have a critical problem about uploading files on the server by asp.net.
I choosed the HTML control "File" and Make it run as server control , and got its file name by the statement
string fname=File1.PostedFile.FileName
then i want to save it on the server Hard Disk so i used the statement :
try
{
File1.PostedFile.SaveAs(Server.MapPath("Project\\"+ff));
}
catch
{
Directory.CreateDirectory(Server.MapPath("Project\\"+ff));
File1.PostedFile.SaveAs(Server.MapPath("Project\\"+ff));
}
When running the page the following exception occured
Access to the path "c:\inetpub\wwwroot\Cubicle\Project\MyFile.doc" is denied.
which "c:\inetpub\wwwroot\Cubicle\" is my project directory (my project name is Cubicle)
Note : i configured the IIS options to be write ,read, and Directory browsing . and the problem is still exist .
Can any one help me ?
Thank You.
Life Is A Big Code
Rushdy Ibrahim
Egypt
Rushdy Ibrahim
Egypt
•
•
Join Date: Jul 2005
Posts: 483
Reputation:
Solved Threads: 19
try
ASP.NET Syntax (Toggle Plain Text)
{ File1.PostedFile.SaveAs(Server.MapPath("\\Project")+"\\" + ff); } catch { try { Directory.CreateDirectory(Server.MapPath("Project")); File1.PostedFile.SaveAs(Server.MapPath("Project")+"\\" + ff); } catch(Exception exp) { string message = exp.Message; } }
Last edited by campkev; Apr 12th, 2006 at 6:59 pm. Reason: added code tags
Thank you All
i have solved the problem from IIS Configuration by right click on the project name (from IIS window) and then All Tasks -> Permission Wizard and select read,write permissions.
it is solved now . and was no problem with the code .
Thank you again .
i have solved the problem from IIS Configuration by right click on the project name (from IIS window) and then All Tasks -> Permission Wizard and select read,write permissions.
it is solved now . and was no problem with the code .
Thank you again .
Life Is A Big Code
Rushdy Ibrahim
Egypt
Rushdy Ibrahim
Egypt
•
•
Join Date: Nov 2007
Posts: 1
Reputation:
Solved Threads: 0
hello all, I'm new here
I try to follow everything in Google search to resolve my problem
but nothing done
I'm trying to upload file in asp.net
the same error of " Access to the path 'c:\inetpub\wwwroot\aa' is denied. " repeated every time I try to upload
so how to manage this problem ? I put all privileges to aspnet user and also to all user , but nothing changed
any help pleas , please
I try to follow everything in Google search to resolve my problem
but nothing done
I'm trying to upload file in asp.net
the same error of " Access to the path 'c:\inetpub\wwwroot\aa' is denied. " repeated every time I try to upload
so how to manage this problem ? I put all privileges to aspnet user and also to all user , but nothing changed
any help pleas , please
•
•
•
•
hello all, I'm new here
I try to follow everything in Google search to resolve my problem
but nothing done
I'm trying to upload file in asp.net
the same error of " Access to the path 'c:\inetpub\wwwroot\aa' is denied. " repeated every time I try to upload
so how to manage this problem ? I put all privileges to aspnet user and also to all user , but nothing changed
any help pleas , please
1. IIS on the folder you want to upload you need to check the allow write check box
2. right click the actual folder in file explorer and allow everyone to write to this folder. Please remember the web user is a low permission user IIS_ somthing.
![]() |
Similar Threads
- access denied to slave hard drive -my docs (Windows NT / 2000 / XP)
- msconfig access denied (Windows NT / 2000 / XP)
- Access denied from files. (Windows NT / 2000 / XP)
- Windows XP Access Denied to slave drive files (Windows NT / 2000 / XP)
Other Threads in the ASP.NET Forum
- Previous Thread: discussion forum
- Next Thread: (Please Help :o( ) Config Error: "Login failed for user 'STS-SYNMAC\userName'."
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dropdownlist dropdownmenu dynamic edit embeddingactivexcontrol expose findcontrol flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list login menu microsoft mono mssql multistepregistration nameisnotdeclared numerical objects order panelmasterpagebuttoncontrols problem ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql sqlserver2005 ssl suse textbox tracking unauthorized validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment webservice wizard xml youareanotmemberofthedebuggerusers





