hello folks..
i have created a text file on the server sales.txt , which i would like to download to the client
...
// open a file to export data
// to /home/sites/www.mplaser.intranet/web/sales.txt ...
$file = "/home/sites/site1/web/sales.txt" ;
$open = fopen($file,"w+") ;
// write selected information to a file ..........
fwrite($open,$sales);
fclose($open);
// download ??
header("Cache-control: private"); // fix for IE
header("Content-Type: application/octet-stream");
header("Content-Length: ".filesize($file));
header("Content-disposition: attachment; filename=$file");
....
at present what is downloaded is a truncated version of the html page that contain the above php
can anyone offer any advice here, have taken a look at the manual and the forum but have not as yet found anything that works
many thanks
paul