0
Answer

Webclient stuff

Michael

Michael

17y
2.1k
1
So I am trying to upload a file to a folder on my website, the code I am using is this

            WebClient  Client = new WebClient();
            NetworkCredential networkCredential = new NetworkCredential("username",      "password");
            networkCredential.Domain = "???";//not sure what goes here
            Client.Credentials = networkCredential;
            Client.UploadFile("http://www.mysite.net/myfolder/","POST", @"pathtofile");

but i get an error saying The remote server returned an error: (404) Not Found. when it comes to the Client.UploadFile() function.

Any help on how to fix this would be wonderfull.