1) For the FTP protocol, it is possible to use the CopyToAnotherServer
method on some FTP servers. It utilizes the FXP functionality, which should be supported by the source FTP server software.
// connect to the source server
Ftp session1 = new Ftp();
session1.Connect(server1);
session1.Login(username1, password1);
// connect to the destination server
Ftp session2 = new Ftp();
session2.Connect(server2);
session2.Login(username2, password2);
// copy a single file from server1 to server2
session1.CopyToAnotherServer(session2, sourcePath, destinationPath);
Please note that even if the FTP server supports the server-to-server transfers (FXP), it is usually disabled by default.
2) For the SFTP protocol, there is unfortunately nothing like the FXP technology.