0 votes
by (150 points)

TransferProgressChanged event is always triggered twice when progress percentage is 100, Do you know why it behaves of this way?

thanks in advance.

Applies to: Rebex SFTP

1 Answer

0 votes
by (72.7k points)

Please note, that the SftpTransferProgressChangedEventArgs object contains TransferState property. It tells you, in which state the event was raised.

The first 100% occurred in state DataBlockProcessed. The second one occurred in state FileTransferred.

For a small file, the TransferProgressChanged event will raise with this values:

FileTransferring: 0%
DataBlockProcessed: 100%
FileTransferred: 100%

In multi file operation (Download or Upload method) it will look like this:

FileTransferring: 0%
DataBlockProcessed: 100%
FileTransferred: 100%
TransferCompleted: 100%
...