Hey,
I have a PDF document which I need to be able to download. The code I used worked last week no problem - but now it doesn't. However the same PDF document is emailed aswell and it opens fine, just when being downloaded through IE (maybe others aswell) that it comes back that it can't be open as its corrupted or not a supported file type.
Code below:
if (isset($downloadinvoice)) {
$invoice = basename($file, ".pdf");
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=\"".$vat_reg."_".$invoice.".pdf\"");
header("Content-Transfer-Encoding: binary");
readfile("$file");exit;
}
I appreciate any help.
Thanks