4 ms·
Content-Encoding: gzip implies a gz header. zlib.deflate just deflates and emits headerless data. Because creating a valid header requires the length of the con
by pilif 14y ago
Content-Encoding: gzip implies a gz header. zlib.deflate just deflates and emits headerless data. Because creating a valid header requires the length of the content to be known, there's no stream filter in PHP to create a gz header.
To see Chrome decode your test image, use gzencode() or set Content-Encoding to deflate.
- thomseddon 14y agoRight you are! Thanks alot. http://www.thestudentcloud.co.uk/hn/test2.php http://www.thestudentcloud.co.uk/hn/test2.php <?php header('Content-Encoding: gzip'); header('Content-Type: image/jpeg'); $data = file_get_contents('test.jpg'); $gzdata = gzencode($data, 9); $fout = fopen('php://output', "w"); fwrite($fout, $gzdata); fclose($fout);