diff options
author | Sashi20 | 2020-07-24 10:46:04 +0530 |
---|---|---|
committer | Sashi20 | 2020-07-24 10:46:04 +0530 |
commit | 3a8e8b0f13e38dcd22e6452a12b16d76ac45c877 (patch) | |
tree | 8134cb0822cea2cbfe911431ea909186b06a4c4b /pdf | |
parent | 9d06c655f7e4a1aa66022b45ffd4fdf4044466d4 (diff) | |
download | cfd_case_study-3a8e8b0f13e38dcd22e6452a12b16d76ac45c877.tar.gz cfd_case_study-3a8e8b0f13e38dcd22e6452a12b16d76ac45c877.tar.bz2 cfd_case_study-3a8e8b0f13e38dcd22e6452a12b16d76ac45c877.zip |
Modify headers to download the certificate
Diffstat (limited to 'pdf')
-rwxr-xr-x | pdf/cert_new.inc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/pdf/cert_new.inc b/pdf/cert_new.inc index f154ecc..8fb6e5c 100755 --- a/pdf/cert_new.inc +++ b/pdf/cert_new.inc @@ -42,7 +42,8 @@ function generate_pdf() } //!$pdf $pdf->AddPage(); $image_bg = $mpath . "/pdf/images/bg_cert.png"; - $pdf->Image($image_bg, 0, 0, $pdf->w, $pdf->h); + //$pdf->Image($image_bg, 0, 0, $pdf->w, $pdf->h); + $pdf->Image($image_bg, 0, 0, $pdf->GetPageWidth(), $pdf->GetPageHeight()); //$pdf->Rect(5, 5, 267, 207, 'D'); $pdf->SetMargins(18, 1, 18); //$pdf->Line(7.0, 7.0, 270.0, 7.0); @@ -200,17 +201,25 @@ function generate_pdf() $filename = str_replace(' ', '-', $data3->contributor_name) . '-CFD-case-study-Certificate.pdf'; $file = $path . '/pdf/temp_certificate/' . $proposal_id . '_' . $filename; $pdf->Output($file, 'F'); - header("Content-Type: application/octet-stream"); - header("Content-Disposition: attachment; filename=" . $filename); - header("Content-Type: application/octet-stream"); - header("Content-Type: application/download"); + ob_clean(); + header("Pragma: public"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); + header("Cache-Control: public"); header("Content-Description: File Transfer"); + header("Content-Type: application/pdf"); + header("Content-Disposition: attachment; filename=" . $filename); header("Content-Length: " . filesize($file)); + header("Content-Transfer-Encoding: binary"); + header("Expires: 0"); + header("Pragma: no-cache"); flush(); $fp = fopen($file, "r"); while (!feof($fp)) { echo fread($fp, 65536); flush(); + ob_end_flush(); + ob_clean(); } //!feof($fp) fclose($fp); unlink($file); |