0 votes
by (120 points)

In our dotnet core application, we subscribe to the TransferProgressChanged event, but it triggers many TransferProgressState.FileTransferring events. Almost exactly 10 time each time. We are able to get the TransferProgressState.TransferCompleted to trigger once, but we can't seem to get an equivalent for transfer started. Why would the file transferring trigger 10 times for each file?

1 Answer

0 votes
by (72.7k points)

Can you please provide us with a small code which reproduce the issue?
I have tried it for myself and it is working as expected (FileTransferring event is triggered once for each file).
I tried this:

var client = new Sftp();
client.Connect("test.rebex.net");
client.Login("demo", "password");

client.TransferProgressChanged += (s, e) =>
{
    switch (e.TransferState)
    {
        case TransferProgressState.FileTransferring:
            Console.WriteLine("FileTransferring: {0}", e.TargetPath);
            break;
        case TransferProgressState.FileTransferred:
            Console.WriteLine("FileTransferred: {0}", e.TargetPath);
            break;
        case TransferProgressState.TransferCompleted:
            Console.WriteLine("TransferCompleted: {0}", e.TargetPath);
            break;
    }
};

client.Download("*", "c:/temp", 0, 0, ActionOnExistingFiles.OverwriteAll);
...