Skip to content

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

Closed as not planned

Description

@martoiu

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>

Activity

  1. robinrodricks commented on Sep 8, 2020

    @robinrodricks
    Owner

    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.

  2. martoiu commented on Sep 8, 2020

    @martoiu
    Author

    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.

  3. Sonic3R commented on Nov 20, 2020

    @Sonic3R

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

  4. robinrodricks commented on Sep 19, 2022

    @robinrodricks
    Owner

    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!

  5. dlambert-personal commented on Jan 5, 2024

    @dlambert-personal

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址