using Rebex.Net;

Welcome to using Rebex.Net; Sign in | Help
in Search

Using Rebex.Net

News and announcements about Rebex.NET components

HOWTO: Transfer compression in SFTP and SSH Shell

A feature that is requested very often is integrated transfer compression in Rebex SFTP. This is particularly useful when transferring text files or other highly compressible files, and a similar feature is already included in Rebex FTP. So why does it take so long to add this to SFTP as well? The problem is that the .NET Framework compression API is well-suited to be used in protocols utilizing stream transfer modes such as FTP, but entirely unsuitable for protocols using block transfer mode such as SSH, the underlying protocol used by SFTP.

Built-in ZLIB compression support was introducted in build 3588. How do we enable it? Just add few additional lines to your application:

C#

Sftp sftp = new Sftp();
SshParameters parameters = new SshParameters();
parameters.Compression = true;
sftp.Connect(hostname, password, parameters);

VB.NET

Dim sftp As New Sftp
Dim parameters As New SshParameters
parameters.Compression = True
sftp.Connect(hostname, password, parameters)

In Rebex SSH Shell, an equivalent code can be used.

Published Tuesday, June 09, 2009 3:58 PM by Lukas Pokorny
Filed under: ,

Comments

No Comments
New Comments to this post are disabled
Powered by Community Server (Personal Edition), by Telligent Systems