mirror of
https://github.com/24eme/signaturepdf
synced 2026-03-14 13:55:44 +01:00
Delete origine file
This commit is contained in:
parent
73f896df3f
commit
b5777e4f5f
1 changed files with 6 additions and 11 deletions
17
app.php
17
app.php
|
|
@ -429,22 +429,17 @@ $f3->route ('POST /compress',
|
|||
|
||||
if ($returnCode === false) {
|
||||
echo "PDF compression failed.";
|
||||
unlink($outputFileName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (filesize($filePath) <= filesize($outputFileName)) {
|
||||
} elseif (filesize($filePath) <= filesize($outputFileName)) {
|
||||
$error = "pdfalreadyoptimized";
|
||||
unlink($outputFileName);
|
||||
header('location: /compress?err=' . $error);
|
||||
return;
|
||||
} else {
|
||||
header('Content-Type: application/pdf');
|
||||
header("Content-Disposition: attachment; filename=$outputFileName");
|
||||
readfile($outputFileName);
|
||||
}
|
||||
|
||||
header('Content-Type: application/pdf');
|
||||
header("Content-Disposition: attachment; filename=$outputFileName");
|
||||
readfile($outputFileName);
|
||||
|
||||
unlink($outputFileName);
|
||||
unlink($filePath);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue