I have control application that generates 3 documents in pdf format. When the users clicks OK, there is a on Validate process that runs. When completed I would like to download them to the users Desktop.
Below the sample code that should download the same document twice (2), but it only does it once.
I get it right to download 1 document. Clicking on OK again does nothing.
I have tried doing this a Function, Code snippet. Any suggestion?
$path = $_SESSION[‘scriptcase’][‘download’][‘glo_nm_path_doc’]."/float_data/";
$fname = “xample.pdf”;
$fullname=$path.$fname;
$filepath = $fullname;
header(‘Content-type: application/octet-stream’);
header("Content-Type: ".mime_content_type($filepath));
header(“Content-Disposition: attachment; filename=”.$filepath);
while (ob_get_level()) {
ob_end_clean();
}
readfile($filepath);
flush();
readfile($filepath);
flush();
fclose;