diff --git a/src/endpoints/characters.js b/src/endpoints/characters.js index 571eec8c0..929818ade 100644 --- a/src/endpoints/characters.js +++ b/src/endpoints/characters.js @@ -1098,7 +1098,7 @@ router.post('/export', jsonParser, async function (request, response) { const fileContent = await fsPromises.readFile(filename); const contentType = mime.lookup(filename) || 'image/png'; response.setHeader('Content-Type', contentType); - response.setHeader('Content-Disposition', `attachment; filename=${path.basename(filename)}`); + response.setHeader('Content-Disposition', `attachment; filename="${encodeURI(path.basename(filename))}"`); return response.send(fileContent); } case 'json': {