I created a class for creating ZIP files in PHP. An alternative to ZipArchive provided that the server is not allowed. Something to use with these free servers.
It already works, builds ZIP structures with PHP and uses gzdeflate () to generate compressed data.
The problem is that gzdeflate () requires me to load the entire file into memory, and I want the class to work with a limit of up to 32 MB. Currently, it stores files larger than 16 MB without compression at all.
I assume that I need to compress the data in blocks, 16 MB to 16 MB, but I do not know how to combine the result of two gzdeflate ().
I tested it, and it seems that it requires some math for the last 16 bits, it seems buff->last16bits = (buff->last16bits & newblock->first16bits) | 0xfffe, it works, but not for all samples ...
Question: How to combine two DEFLATEd streams without unpacking it?
source
share