Just a little thing more from the ssharma's script (thx to him for his great help ...) :
Don't forget to put the fopen with the "rb" argument and not just with the "r"
or you won't be able to make the script work with all pdf file.
My final script (working for Open and Save on a 1.9 Mb complex PDF file) :
<?php
//The filename is stored in the $produitFilename variable in my script (the only thing you need)
// You need to specify the REAL path for your file and not the URL
$fullPath = getcwd()."./directory_where_the_file_is/".$produitFilename;
if ($fd = fopen ($fullPath, "rb")) {
$fsize =filesize($fullPath);
$fname = basename ($fullPath);
header("Pragma: ");
header("Cache-Control: ");
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"".$fname."\"");
header("Content-length: $fsize");
fpassthru($fd);
}
?>
Have fun and thx u all 4 ur great help ...
Simon (from Paris - France)