views:

122

answers:

1

How can I get a Stream object to read the file that is on SFTP share? I see that there is functionality to download a file from SFTP using Sftp class, but I need a Stream object to be able to show the download progress.

A: 

I'm not familiar with SharpSSH, but edtFTPnet/PRO, which is a commercial .NET library supporting SFTP and FTPS, uses a BytesTransferred event that you can subscribe to.

So you regularly get notified of how much has been downloaded or uploaded, and if you grab the size before transferring, you can easily then calculate download progress.

I assume SharpSSH has a similar event you can subscribe to.

Bruce Blackshaw