Problem in HTTPS File Transfer RRS feed

  • Question



    I want to automate the the process of file transfering from a HTTPS server. Uptil now, I transfer files by loging to a HTTPS site, by giving username and password. After athuntication there is a web interface provided by the site through that I can upload or download files. But now I want to write a console based C# program that will perform this task.

    Kindly share your relevant experiances...

    I am trying following code for this, but in response I get message that "Virtual User ABC has loged in." but there is no information about the file uploading in response. Also I am unable to see the file uploaded at the destination. Kinldy checl if there is any thing missing in the code... And also guide if there are some other solutions.

    WebClient client = new WebClient();

    String userName = "abc";

    String userPass = "abc";

    System.Net.NetworkCredential ntCrd = new NetworkCredential(userName, userPass);

    client.Credentials = ntCrd;

    byte[] responseArray = client.UploadFile(https://abc/folder/, "c:\\test.txt");

    string response = Encoding.UTF8.GetString(responseArray);

    Console.Write(response + "\n" + "file uploaded");



    Friday, November 21, 2008 1:22 PM