mirror of
https://github.com/24eme/signaturepdf
synced 2026-03-14 13:55:44 +01:00
compress: fix filename encodage
This commit is contained in:
parent
dd3a6ca161
commit
35ce1467ea
2 changed files with 2 additions and 2 deletions
2
app.php
2
app.php
|
|
@ -486,7 +486,7 @@ $f3->route ('POST /compress',
|
|||
return;
|
||||
} else {
|
||||
header('Content-Type: application/pdf');
|
||||
header("Content-Disposition: attachment; filename=".basename(str_replace(".pdf", "_compressed.pdf", $originalFilename)));
|
||||
header("Content-Disposition: attachment; filename=".urlencode(basename(str_replace(".pdf", "_compressed.pdf", $originalFilename))));
|
||||
readfile($outputFileName);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
document.querySelector('#error_message').classList.remove('d-none');
|
||||
document.querySelector('#error_message').innerText = trad["Your pdf is already optimized"];
|
||||
} else if (response.ok) {
|
||||
let filename = response.headers.get('content-disposition').replace('attachment; filename=', '');
|
||||
let filename = decodeURI(response.headers.get('content-disposition').replace('attachment; filename=', ''));
|
||||
let blob = await response.blob();
|
||||
|
||||
document.querySelector('#compressBtn').classList.remove('btn-primary');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue