Search code examples
c#asp.netnet-sftp

How to Move a file to SFTP server using SharpSSH


need to move file from one folder to another on filezilla using Tamir.SharpSsh.Sftp.

    Tamir.SharpSsh.Sftp client = new Tamir.SharpSsh.Sftp(address, username, password);
    client.Connect();
    client.? // for move file from one folder to another 

Solution

  • Try this...

    Tamir.SharpSsh.Sftp client = new Tamir.SharpSsh.Sftp(address, username, password);
    client.Connect();
    if(client.Connected) {
        client.Rename("/source/path/file.zip", "/destination/path/file.zip");
    } else {throw new ... }
    

    On *nix OSes, move and rename are synonymous. Sftp seems to have inherited the design.