Hi,
I want to transfer compressed html-files from the server to the browser. I'm using gzip, therefore the extension is *.gz. After ensuring http_accept_encoding is gzip the file example.html.gz is displayed in the browser window properly as a html-file. In the status window is displayed the real size of the compressed file. But actually I want that in the status window is displayed the decompressed size while decompressing.
Once I figured out to write a little php-script like the following:
EXAMPLE.PHTML
<?php
$filename="example.html.gz";
$filehandle=fopen($filename, "r");
$content=fread($filehandle, filesize($filename));
fclose($filehandle);
header ("Content-Type: text/html\n\n");
echo $content;
?>
Consider, this script above doesn't work. But the script I once created worked quite properly, but unfortunately I deleted it and now I cannot remember what I did to make it possible. I tried many possibilities to figure it out, but no way. The solution is not "header ('Content-Encoding: gzip')", that would be the same as a direct request to the example.html.gz.
I think the solution is to find in the kind of content-type. When does the browser show the uncompressed size of file while decompressing used a special content-type?
Please, I need help quickly.
Thomas.