Skip to content

Commit

Permalink
fix(server): images with non-ascii names failing to load (#14512)
Browse files Browse the repository at this point in the history
* utf-8 filename

* Update file.ts

Co-authored-by: Michel Heusschen <[email protected]>

---------

Co-authored-by: Michel Heusschen <[email protected]>
  • Loading branch information
mertalev and michelheusschen authored Dec 6, 2024
1 parent d364773 commit 07096bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/utils/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' };
Expand Down

0 comments on commit 07096bd

Please sign in to comment.