FluentFTP icon indicating copy to clipboard operation
FluentFTP copied to clipboard

UploadDirectory with FtpFolderSyncMode.Update reads all the remote folders and files

Open martoiu opened this issue 5 years ago • 3 comments

FTP OS: Windows

FTP Server: Dont know

Computer OS: Windows

FluentFTP Version: 32.4.4

The remote folder contains a very large number of folders and files. The local folder only three small files. But uploading takes forever.

In the output window in Visual studio I see alle the remote folders and remote files passing by. I assume that the directory upload should look at the local folder, walk the subfolders and the files and check wether they exist on the remote folder. Thus it is not necessary to walk all the remote folders.

Excuse if I assume something wrong, I am a newbie in C# and FTP.

Here is my code:

	public static void UploadDirectory(string HostName, int port, string UserName, string Password, string LocalPath, string RemotePath, string LogPath )
	{
		using (var ftp = new FtpClient(HostName,UserName , Password))
		{
			try
			{
				ftp.Connect();
			}
			catch (Exception e)
			{
                System.Windows.Forms.MessageBox.Show($"Cannot connect. Error {e.Message}");
				return;
            }

			// upload a folder and all its files
			List<FtpResult> f = ftp.UploadDirectory(LocalPath, RemotePath, FtpFolderSyncMode.Update);
			ftp.Disconnect();
		}
	}

Logs : Do I need to upload the logs?


<paste logs here>

martoiu avatar Sep 08 '20 00:09 martoiu

Currently we support 2 modes, update and mirror. In any mode, the remote directory is fully listed, then compared, then the actually upload begins. This is done in order to skip files that are already uploaded. We can support a third mode, maybe like BlindTransfer which will not list the remote directory.

robinrodricks avatar Sep 08 '20 12:09 robinrodricks

Please do something about it. I have tried the example from WinSCP, which synchronizes two folders, and it uploaded in miliseconds. FluentFTP was still bussy after 15 minutes when I broke the operation. I would rather use FluentFTP than WinSCP, but without the promised enhancement I cannot use it.

martoiu avatar Sep 08 '20 13:09 martoiu

@robinrodricks : would be nice that feature, I encounter same issue as @martoiu

Sonic3R avatar Nov 20 '20 08:11 Sonic3R

Added to the bucket list. We will pick this up as and when we have free time. Comment on this issue if you want us to prioritize it. Thanks!

robinrodricks avatar Sep 19 '22 14:09 robinrodricks

FWIW, I'm stuck on the same issue -- I've got a remote server with a ton of files, and my updates are timing out. I turned on logging (worked great, btw), and was able to see the better part of a million lines of logs - almost all of which were getting remote directory listings. This is going to be a showstopper for me. Is this feature still considered not planned?

dlambert-personal avatar Jan 05 '24 19:01 dlambert-personal