|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-29 17:54 UTC] avaurus at schipplock dot de
<?php
# look at this :
# -----------------
# try to use just strings instead of variables -> will work :>
# try to use variables instead of just strings -> will NOT work :/
# -----------------
# it is really a mess with some functions of php under windows
$fontfile = str_rot13($id);
$gzfilename = str_replace(".ttf","",$fontfile);
header("Content-Disposition: attachment; filename=\"$gzfilename.gz\"");
header("Content-type: application/x-gzip");
$data = implode("", file("fonts/".$fontfile));
$gzdata = gzencode($data, 9);
$fp = fopen("fonts/".$gzfilename.".gz", "w");
fwrite($fp, $gzdata);
fclose($fp);
readfile("fonts/".$gzfilename.".gz");
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 18:00:01 2025 UTC |
You are most likely using file() function to retrieve binary files. What if replacing $data = implode("", file("fonts/".$fontfile)) by $data = file_get_contents("fonts/".$fontfile); ??