Short example for PHP:
$fp = fopen($icoFile, 'r');
// cache control headers
header("Pragma: public");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
// send the right headers
header("Content-Type: text/plain");
header("Content-Length: " . filesize($icoFile));
header("Content-disposition: attachment; filename=" . basename($icoFile));
fpassthru($fp);
fclose($fp);
0 comments:
Post a Comment