I am trying to implement MODE Z compression for FTP using C# for an FTP client that I have written. My understanding is that MODE Z uses the same compression as zlib. I cannot get zlib.net from componentace to work. It hacks off the last part of the file after the upload to a FileZilla FTP Server. Where are the specs for MODE Z? Has anyone else had problems with zlib.net? The deflate in the .NET Framework isn't compatible with MODE Z either.
I don't think FTP compressed mode has made it to an RFC yet. There is an (expired) Internet Draft from September 2005.
You might try emailing one of the authors for current status if you get really stuck (see section 7, Authors' addresses).
RFCs 1950 and 1951 (zlib and deflate respectively) may also be useful to you for low-level debugging. I don't entirely understand the relationship of those two RFCs, however Section 3.3.1 of the above Internet Draft states:
All FTP processes that support deflate transmission mode MUST support the ZLIB compressed data format specified in RFC 1950 [5].
so it certainly sounds like you are using the correct C# component.
It would be good to confirm where the truncation is taking place: are you sure it's in the compression library? Can you dump the compressed data before you upload? Can you watch the bytes go over the wire? Can you trace the server side to see if it receives the entire file (but then truncates it)?
If you want an inexpensive FTP library that supports MODE Z, try edtFTPnet/Express. You can even purchase the source code if you like to take a look at how we've implemented compression with zlib.net.