Hi,
this is what I use:
$thisfile = "readme.txt";
$dbn = "".$thisfile."";
$fp = fopen($dbn, "rb");
$sdata = fread($fp, filesize($dbn));
fclose($fp);
if (strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 5.5"))
{
$att = "";
}
else
{
$att = " attachment;";
}
// $filename = "file.pdf";
header("Cache-control: private"); // fix for IE
header("Content-Type: application/octet-stream");
header("Content-Length: ".filesize($thisfile));
header("Content-Disposition: attachment;
filename=$thisfile");
$fp = fopen($thisfile, 'r');
fpassthru($fp); // ** CORRECT **
(I grabbed it from a much larger script, so I am not sure this works straight away. But you get the idea?)
J.