Browse Source

Create a real tmp file for resulting PDF

currency
7u83 4 years ago
parent
commit
47aa9982c0
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      submit.php

+ 5
- 2
submit.php View File

@ -300,18 +300,21 @@ foreach ($_POST['description'] as $key => $val) {
}
//var_dump($pdfs);
//
$resultnam = tempnam("/tmp","karesult");
$cmd = "$CONVERT_CMD";
foreach ($pdfs as $filename){
$cmd .= " $filename";
}
$cmd .= " cat output /tmp/result.pdf";
$cmd .= " cat output $resultnam.pdf";
exec ($cmd);
//var_dump($_POST);
#echo "CMD: $cmd<br>";
#die;
$file = "/tmp/result.pdf";
$file = "$resultnam.pdf";
header('Content-Disposition: attachment; filename="'. basename($file) . '"');
header('Content-Length: ' . filesize($file));
readfile($file);

Loading…
Cancel
Save