some filename fixes for nicer extraction

This commit is contained in:
Anthony Stirling
2023-05-26 14:39:08 +01:00
parent bc55b5fdda
commit 5e4de6cc5f
4 changed files with 10 additions and 10 deletions

View File

@@ -400,16 +400,15 @@ document.addEventListener("DOMContentLoaded", function () {
}
let contentDisposition = response.headers.get('content-disposition');
let fileName = "file.pdf"
let fileName = "file.pdf"
if (!contentDisposition) {
//throw new Error('Content-Disposition header not found for file ' + i);
} else {
fileName = contentDisposition.split('filename=')[1].replace(/"/g, '');
fileName = decodeURIComponent(contentDisposition.split('filename=')[1].replace(/"/g, ''));
}
console.log('Received response for file ' + i + ': ' + response);
let blob = await response.blob();
if (zipFiles) {
// Add the file to the ZIP archive