FTP handling compression level and server support

0 votes
asked Dec 8, 2015 by nevar (280 points)

Is there currently a way to set the compression level used by rebex ftp client?

In addition is there a way to check to see if the server reports that it supports compression before attempting to turn it on? If not, how is compression support not be allowed by the server currently handled? Is this an exception or event that is raised?


Applies to: Rebex FTP/SSL

1 Answer

+1 vote
answered Dec 9, 2015 by Tomas Knopp (58,890 points)
edited Aug 29, 2016 by Tomas Knopp
Best answer


In version 2016R1 we've added a new CompressionLevel property into ftp.Settings so that you are able to change the Compression level used in mode Z.
Download the free trial of Rebex FTP/SSL

Please note that the setting will only be effective for uploading files, as the compression level used when downloading is determined by the FTP server.

As to your other question - if you turn on mode Z, and the FTP server does not support it, the Rebex FTP client will automatically fallback to mode S (FtpTransferMode.Stream). We have improved the FTP Mode Z documentation on our features page - thanks! This being said, setting the Zlib mode is safe like this whether the server supports it or not:

Ftp ftp = new Ftp();
ftp.TransferMode = FtpTransferMode.Zlib;
commented Dec 10, 2015 by Tomas Knopp (58,890 points)
edited Dec 10, 2015 by Tomas Knopp
The new version that supports setting the CompressionLevel (in mode Z for upload operations) is now available for download at

I have added the ftp.Settings.CompressionLevel property so that now you can specify the compression level like this:

            Ftp ftp = new Ftp();
            ftp.TransferMode = FtpTransferMode.Zlib;
            ftp.Settings.CompressionLevel = ...; // choose anything from 0(no compression) to 9(best compression). 6 is default.

            ftp.Connect("server", 21);
            // etc.
commented Dec 14, 2015 by nevar (280 points)
Thanks for this. I will download and implement after Christmas.
commented Jan 13, 2016 by Tomas Knopp (58,890 points)
edited Aug 10, 2016 by Tomas Knopp
This has been officially released as part of Rebex components version 2016R1.