1
0
Fork 0
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:
Vincent LAURENT 2024-12-15 00:26:59 +01:00
commit a2a581ab6a

View file

@ -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')) {