|
Is there some property or method to measure and display the kilobytes per second of a file transfer for both Ftp and Sftp? Thanks in advance, Richard |
|
There is no such property yet (update - it was added in build 3723), but calculating he file transfer speed is quite easy - please download this modified GetPut sample (C#) and give it a try - it now shows how to use a TransferProgress event handler to calculate the current transfer rate. It should be simple enough to follow and use in other applications. The code is for Rebex FTP or FTP/SSL, but simply changing the event args name will make it work with Rebex SFTP as well. If you prefer VB.NET, please let us know. Sample code for Rebex FTP or FTP/SSL until 3.0.3588.0:
Update: Sample code for Rebex FTP or FTP/SSL 3.0.3723.0 and later
|
|
Thanks Lukas! Using your example code I converted to VB.NET and added a small modification to give both percentage of complete plus the KB per second:
with these lines before starting file transfer:
and since our upload transfer list comes from a database array I used this sub to determine the filesize of the localFile:
Anyway, it gave me what I needed thanks to your help! Thanks to you as well! We have added build-in support for this to the latest release - check out propertyFtpTransferProgressEventArgs object's BytesPerSecond property. Note: We foud out that the code we posted here doesn't work properly when the transfer speed is very high due to the limited precision of Environment.TickCount. The built-in BytesPerSecond property solves this.
(17 Mar '10, 14:46)
Lukas Pokorny ♦♦
|
|
This feature should be built into all of Rebex products by default. It makes thing much easier. I vote for one. We agree - it is included in the latest build of Rebex FTP/SSL and Rebex SFTP! There is now a BytesPerSecond property in FtpTransferProgressEventArgs/SftpTransferProgressEventArgs classes.
(17 Mar '10, 14:40)
Lukas Pokorny ♦♦
|