may be resource not allowed to upload, be sure the IIS security in server...
let you try this coding
<%@ Import Namespace="System"%>
<%@ Import Namespace="System.IO"%>
<%@ Import Namespace="System.Net"%>
<%@ Import NameSpace="System.Web"%>
<Script language="C#" runat=server>
void Page_Load(object sender, EventArgs e) {
foreach(string f in Request.Files.AllKeys) {
HttpPostedFile file = Request.Files[f];
file.SaveAs("c:\\inetpub\\test\\UploadedFiles\\" +
file.FileName);
}
}
</Script>
<html>
<body>
<p> Upload complete. </p>
</body>
</html>
----- Original Message -----
From: "Clyde" <[EMAIL PROTECTED]>
To: "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" <[email protected]>
Sent: Tuesday, August 26, 2008 7:01 AM
Subject: [DotNetDevelopment] "The remote server returned an error: (405)
Method Not Allowed."
>
> I m trying to upload files to a webserver.
> In a console application, I write d following code,
> WebClient myWebClient = new WebClient();
> myWebClient.UploadFile("http://LocalHost/HttpsApp/
> Default.aspx", @"C:\holi.txt");
> I get a runtime error on line 2 saying:"The remote server returned an
> error: (405) Method Not Allowed."
> I tried to google it out but didnt find a solution.
> Ur help asap wud b appreciated .
> Thanx,
> Clyde
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---