G
Guest
Hi All, I am attemting to setup an file upload page in asp.net C# 2005 .net
2.0. I am receiving an "The remote server returned an error: (401)
Unauthorized." error when uploading. Here is my code:
System.Net.WebClient oWebClient = new System.Net.WebClient();
byte[] btResponse =
oWebClient.UploadFile("http://localhost/foo/getupload.aspx", "POST",
"c:\\test.txt");
*****And the receiving code*******
protected void Page_Load(object sender, EventArgs e)
{
foreach (string f in Request.Files.AllKeys)
{
HttpPostedFile file = Request.Files[f];
file.SaveAs("C:\\inetpub\\wwwroot\\foo\\upload\\" +
file.FileName);
}
}
I have given "everyone" full control and write permissions within IIS to the
"upload" folder located at C:\inetpub\wwwroot\foo\upload\. Please help. I
have spent hours online trying to figure out what I am doing wrong. Thanks.
2.0. I am receiving an "The remote server returned an error: (401)
Unauthorized." error when uploading. Here is my code:
System.Net.WebClient oWebClient = new System.Net.WebClient();
byte[] btResponse =
oWebClient.UploadFile("http://localhost/foo/getupload.aspx", "POST",
"c:\\test.txt");
*****And the receiving code*******
protected void Page_Load(object sender, EventArgs e)
{
foreach (string f in Request.Files.AllKeys)
{
HttpPostedFile file = Request.Files[f];
file.SaveAs("C:\\inetpub\\wwwroot\\foo\\upload\\" +
file.FileName);
}
}
I have given "everyone" full control and write permissions within IIS to the
"upload" folder located at C:\inetpub\wwwroot\foo\upload\. Please help. I
have spent hours online trying to figure out what I am doing wrong. Thanks.