inital commit
This commit is contained in:
35
webroot/V1.0/common_file.php
Normal file
35
webroot/V1.0/common_file.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
$html = str_replace($varList,$valueList,$html);
|
||||
|
||||
include("mpdf60/mpdf.php");
|
||||
$mpdf=new mPDF();
|
||||
$mpdf->SetProtection(array("print"));
|
||||
$mpdf->WriteHTML($html);
|
||||
|
||||
if(isset($deletionArray) && !empty($deletionArray)){
|
||||
foreach($deletionArray as $key=>$value){
|
||||
@unlink($value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$mpdf->Output($file_name);
|
||||
|
||||
|
||||
|
||||
$fullPath = $file_name;
|
||||
|
||||
header("Cache-Control: public");
|
||||
header("Content-Description: File Transfer");
|
||||
header('Content-disposition: attachment;filename='.basename($fullPath));
|
||||
header("Content-Type: application/pdf");
|
||||
header("Content-Transfer-Encoding: Binary");
|
||||
header('Content-Length: '. filesize($fullPath));
|
||||
ob_implicit_flush(true);
|
||||
ob_clean();
|
||||
flush();
|
||||
readfile($fullPath);
|
||||
@unlink($fullPath);
|
||||
exit;
|
||||
?>
|
||||
Reference in New Issue
Block a user