Hi
I've created a script to auto-download a pdf file... what I have works in that the right file is prompted for download but it is 0kb in size once saved to my pc (the file on the server is 0.21Mb).
This is the code I'm using, can anyone see what I may be missing or have done wrong?
header('Content-Description: File Transfer');
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
(I have tried application/octet-stream as well with no success).
Thanks for any help.
JG