Matrixbob
05-05-2011, 10:47
$web_path_file = 'http://' . $_SERVER["SERVER_NAME"] . '/nomecartella/upload/prodotti_rcp/' . $file;
$relative_path_file = 'upload/prodotti_rcp/' . $file;
if (file_exists($relative_path_file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/pdf');
//header("Content-Disposition: inline; filename=$relative_path_file");
header('Content-Disposition: attachment; filename='.basename($relative_path_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($relative_path_file));
ob_clean();
flush();
readfile($relative_path_file);
exit;
}
else {
print "FILE RCP INESISTENTE";
exit;
}
$relative_path_file = 'upload/prodotti_rcp/' . $file;
if (file_exists($relative_path_file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/pdf');
//header("Content-Disposition: inline; filename=$relative_path_file");
header('Content-Disposition: attachment; filename='.basename($relative_path_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($relative_path_file));
ob_clean();
flush();
readfile($relative_path_file);
exit;
}
else {
print "FILE RCP INESISTENTE";
exit;
}