public void RemoteCopy( Ftp destinationFtpServer, string sourceFilePath, string destinationFilePath )
Shows how to use RemoteCopy method to copy a file on an FTP server to another server using direct server-to-server transfer, also known as FXP.
using System; using System.Collections.Generic; using System.Text; using ComponentPro.Net; using ComponentPro.IO; ... // Create a new class instance. Ftp ftp1 = new Ftp(); // Connect to the FTP server. ftp1.Connect("myserver"); // Authenticate. ftp1.Authenticate("userName", "password"); // ... // Create a new class instance. Ftp ftp2 = new Ftp(); // Connect to the FTP server. ftp2.Connect("myserver2"); // Authenticate. ftp2.Authenticate("userName", "password"); // ... // Copy "/myfile.x" file from the first FTP server to the second one. ftp1.RemoteCopy(ftp2, "/myfile.x", "/myfile.x"); // Disconnect. ftp1.Disconnect(); ftp2.Disconnect();