How to Move a file to SFTP server using SharpSSH

Aditya picture Aditya · Feb 23, 2015 · Viewed 8k times · Source

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 

Answer

Basic picture Basic · Feb 23, 2015

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.