I am trying to create a download.php file that will retrieve a file patch from db and ask the user to download it.
To do that, I read up and saw that one needs to do the following:
<?php
$file = "style.css";
header("Content-disposition: attachment; filename=\"$file\"");
header("Content-type: application/octet-stream");
header("Content-Length: ".filesize($file));
header("Pragma: no-cache");
header("Expires: 0");
readfile($file);
?>
Problem: In IE the file shows up as style.css in the save
as dialog, but in Mozilla it shows up as style.css.php and in Netscape it just
asks to save style, but ends up displaying document contained no data.
Anyone got any suggestions as to what I might have overlooked ?