SFTP Client issue

Last post 01-20-2012, 7:03 AM by babar.raza. 1 replies.
Sort Posts: Previous Next
  •  01-09-2012, 12:52 AM 353730

    SFTP Client issue

    Hi,

    I tried the following code to download a file from a remote sftp.

    connection.ChangeDirectory("/AUCTPART1/eliminated");

    connection.Download("ImportPDFFile.pdf", "c:\\temp\\ImportPDFFile.pdf", true);

     

    It tell's me the "AUCTPART1:/AUCTPART1/eliminated" does not exist in the remote server.

    Could you try similar code and see if you have the same issue for sftp, please?

    The code I used to create the connection is :

    using (SftpClient connection = new SftpClient()){

    try

    {

    connection.Connect(Server, Port,

    new AuthenticationInfo(){UserName = this.Login, Password = this.Password});

    }catch (Exception e)

    {

    HandleException(e);

    }

     

     

    Thanks and regards

     

    Bill

     

     

     

     
  •  01-20-2012, 7:03 AM 356487 in reply to 353730

    Re: SFTP Client issue .NET

    Hi Bill, 

    Please accept my apologies for delayed response on your inquiry. 

    I am afraid that I am unable to replicate your said issue with latest version of Aspose.Network for .NET v6.9.0. To test your said issue, I have configured the WinSSHD on local and was able to download the sample file by moving to some other directory as shown in below sample,

    C#
          using (SftpClient connection = new SftpClient())       {             try             {                   connection.Connect("localhost", 22, new AuthenticationInfo() { UserName = "username", Password = "password" });                   connection.ChangeDirectory("/c/");                   connection.Download("NuGet.exe", "C:\\temp\\nuget.exe", true);             }             catch (Exception e)             {                   Console.WriteLine(e.Message);             }       }

    Please give a try to the latest version and let us know of your feedback. If your problem persists then please try to arrange a test account of your SFTP server for a few days. 

    Regards,

    Babar Raza
    Support Developer,
    Aspose Sialkot Team
    http://www.aspose.com/
    Aspose - Your File Format Experts
     
View as RSS news feed in XML