I'm sending a base64 string compressed with zlib in Python, converted to base64, sent to a PHP page where it will be extracted.
I'm having trouble with this. How would I do this?
Right now I have:
python
compressor = zlib.compressobj(wbits=(16+zlib.MAX_WBITS))
compressed = compressor.compress(str)
compressed += compressor.flush()
php
*POST deccoded here, b64data is the output*
$b64data = zlib_decode($data);
I left out the part where I decode from base64. The php code throws and error about invalid data at the zlib function.
zlib_decode(): data error
base64_decode($b64data)maybe... base64_decode , just guessing.It throws an error about invalid compression at the zlib functionthat would have been nice to know, you may want to add that to the question.wbits=(16+zlib.MAX_WBITS)creates a gzip-header instead of the zlib header forwbits=zlib.MAX_WBITS. I don't know if PHP can cope with that.