From 07096bdcee0c8979e3930caaefb4c8be47b87593 Mon Sep 17 00:00:00 2001 From: Mert <101130780+mertalev@users.noreply.github.com> Date: Fri, 6 Dec 2024 08:43:58 -0500 Subject: [PATCH] fix(server): images with non-ascii names failing to load (#14512) * utf-8 filename * Update file.ts Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> --------- Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> --- server/src/utils/file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' };