upload file from window application to Remote Web Server

Posted by user208466 on Stack Overflow See other posts from Stack Overflow or by user208466
Published on 2010-05-21T15:59:14Z Indexed on 2010/05/21 16:10 UTC
Read the original article Hit count: 447

Filed under:
|
|
string filePath = "C:\\test\\564.flv";
try
{
    WebClient client = new WebClient();

    NetworkCredential nc = new NetworkCredential(uName, password);

    Uri addy = new Uri("\\\\192.168.1.28\\Files\\test.flv");
    client.Credentials = nc;
    byte[] arrReturn = client.UploadFile(addy, filePath);
    Console.WriteLine(arrReturn.ToString());
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}

i am get this error "The remote server returned an error: (405) Method Not Allowed." what should i doo ??

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms