fix(frontend): keep the given file name on mobile downloads

FileManager typed every download text/plain. Android's MediaStore appends
the MIME type's extension whenever the name's own extension maps elsewhere,
so a subscriber saving a WireGuard config got peer.conf.txt, which the
WireGuard app refuses; .json, .yaml and .log downloads were renamed the same
way. Desktop browsers honour the download name, which is why only phones
saw it. application/octet-stream carries no extension of its own, so the
name the panel chose is kept.
This commit is contained in:
MHSanaei
2026-09-30 15:03:21 +02:00
parent aee45ca3fe
commit 99047c0a63
2 changed files with 38 additions and 1 deletions
+3 -1
View File
@@ -967,10 +967,12 @@ export class LanguageManager {
}
export class FileManager {
// Typed text/plain, Android's MediaStore saves peer.conf as peer.conf.txt;
// octet-stream carries no extension of its own, so the given name is kept.
static downloadTextFile(
content: BlobPart,
filename: string = 'file.txt',
options: BlobPropertyBag = { type: 'text/plain' },
options: BlobPropertyBag = { type: 'application/octet-stream' },
): void {
const link = window.document.createElement('a');
link.download = filename;