mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-18 06:20:29 +00:00
fix: http download filename special character
This commit is contained in:
parent
1fa740de2d
commit
ad251a7682
@ -193,6 +193,7 @@ export async function uri2local(uri: string, fileName: string | null = null): Pr
|
|||||||
// res.ext = pathInfo.ext
|
// res.ext = pathInfo.ext
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fileName = fileName.replace(/[/\\:*?"<>|]/g, '_');
|
||||||
res.fileName = fileName;
|
res.fileName = fileName;
|
||||||
filePath = path.join(getTempDir(), uuidv4() + fileName);
|
filePath = path.join(getTempDir(), uuidv4() + fileName);
|
||||||
fs.writeFileSync(filePath, buffer);
|
fs.writeFileSync(filePath, buffer);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user