Skip to content

High performance self-hosted photo and video management solution.

fix(server): images with non-ascii names failing to load (#14512)

Mert07096bdcee0c
diff --git a/server/src/utils/file.ts b/server/src/utils/file.ts
index ba487840e5..869e4d7876 100644
--- a/server/src/utils/file.ts
+++ b/server/src/utils/file.ts
@@ -58,7 +58,7 @@ export const sendFile = async (
res.header('Content-Type', file.contentType);
if (file.fileName) {
- res.header('Content-Disposition', `inline; filename="${file.fileName}"`);
+ res.header('Content-Disposition', `inline; filename*=UTF-8''${encodeURIComponent(file.fileName)}`);
}
const options: SendFileOptions = { dotfiles: 'allow' };