mirror of
https://github.com/24eme/signaturepdf
synced 2026-03-14 13:55:44 +01:00
compress: output file name is just the filenname
This commit is contained in:
parent
ce07f5903e
commit
a2a581ab6a
1 changed files with 2 additions and 6 deletions
8
app.php
8
app.php
|
|
@ -429,9 +429,7 @@ $f3->route ('POST /compress',
|
|||
} else {
|
||||
$compressionType = '/screen';
|
||||
}
|
||||
|
||||
$arrayPath = array_keys($files);
|
||||
$filePath = reset($arrayPath);
|
||||
$filePath = reset(array_keys($files));
|
||||
|
||||
$outputFileName = str_replace(".pdf", "_compressed.pdf", $filePath);
|
||||
|
||||
|
|
@ -444,7 +442,7 @@ $f3->route ('POST /compress',
|
|||
header('location: /compress?err=' . $error);
|
||||
} else {
|
||||
header('Content-Type: application/pdf');
|
||||
header("Content-Disposition: attachment; filename=$outputFileName");
|
||||
header("Content-Disposition: attachment; filename=".basename($outputFileName));
|
||||
readfile($outputFileName);
|
||||
}
|
||||
|
||||
|
|
@ -488,8 +486,6 @@ $f3->route('PUT /api/file/save', function($f3) {
|
|||
|
||||
});
|
||||
|
||||
|
||||
|
||||
function getCommit() {
|
||||
if(!file_exists(__DIR__.'/.git/HEAD')) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue