Hi all, which is the most efficient way to download and then move files from one folder to another on an SFTP server using edtFTPnet/PRO ?
I would like to Download all the files in an SFTP folder and move them to another SFTP folder name "old". I must also make sure that I do not pick up any new files from the SFTP that were not downloaded when moving.
At the moment I have the following code:
_secureClient.ServerDirectory = "/home/xxxxx";
FTPFile[] files = _secureClient.GetFileInfos(_secureClient.ServerDirectory, "*.csv", false);
foreach (FTPFile file in files)
{
_secureClient.DownloadFile(localPath, file.Name);
// move from _secureClient.ServerDirectory TO _secureClient.ServerDirectory + "/old"
}
1. Is this the most efficient way to do this?
2. How do I move the files? Is it a simple download from one server directory to another?
Thanks