Skip to content

Commit

Permalink
fix(frontend): correctly parse filenames with umlauts
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Sep 4, 2024
1 parent d1ba488 commit 0a87338
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/app/utils/parse-filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const REGEX =
const parseFileName = (contentDisposition) => {
const { quote, filename } = REGEX.exec(contentDisposition)?.groups ?? {};
if (!filename) return "Unknown file";
return quote ? filename.slice(1, -1) : filename;
const _filename = filename.startsWith("utf-8''")
? decodeURI(filename.replace("utf-8''", ""))
: filename;
return quote ? _filename.slice(1, -1) : _filename;
};

export default parseFileName;

0 comments on commit 0a87338

Please sign in to comment.