Skip to content

Commit

Permalink
compress: output file name is just the filenname
Browse files Browse the repository at this point in the history
  • Loading branch information
wincelau committed Dec 14, 2024
1 parent ce07f59 commit a2a581a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,7 @@ function($f3) {
} else {
$compressionType = '/screen';
}

$arrayPath = array_keys($files);
$filePath = reset($arrayPath);
$filePath = reset(array_keys($files));

$outputFileName = str_replace(".pdf", "_compressed.pdf", $filePath);

Expand All @@ -444,7 +442,7 @@ function($f3) {
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);
}

Expand Down Expand Up @@ -488,8 +486,6 @@ function($f3) {

});



function getCommit() {
if(!file_exists(__DIR__.'/.git/HEAD')) {

Expand Down

0 comments on commit a2a581a

Please sign in to comment.