I'm using the following script to download files from my server. how do you display a message (or can you) after it is done? I tried putting in an echo statement both before and after the code but it never executes.
$filename = 'costos.pdf';
$filename = realpath($filename);
$file_extension = strtolower(substr(strrchr($filename,"."),1));
switch ($file_extension) {
case "pdf": $ctype="application/pdf"; break;
case "doc": $ctype="application/msword"; break;
case "jpg": $ctype="image/jpg"; break;
}
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: $ctype");
/* header("Content-Disposition: attachment;
filename=\"".basename($filename)."\";");*/
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".@filesize($filename));
set_time_limit(0);
@readfile("$filename") or die("File not found.");
$filename = 'costos.pdf';
$filename = realpath($filename);
$file_extension = strtolower(substr(strrchr($filename,"."),1));
switch ($file_extension) {
case "pdf": $ctype="application/pdf"; break;
case "doc": $ctype="application/msword"; break;
case "jpg": $ctype="image/jpg"; break;
}
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: $ctype");
/* header("Content-Disposition: attachment;
filename=\"".basename($filename)."\";");*/
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".@filesize($filename));
set_time_limit(0);
@readfile("$filename") or die("File not found.");