mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: http download filename special character
This commit is contained in:
parent
ce31052661
commit
e9d43a9449
@ -176,6 +176,7 @@ export async function uri2local(uri: string, fileName: string = null): Promise<U
|
|||||||
// res.ext = pathInfo.ext
|
// res.ext = pathInfo.ext
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fileName = fileName.replace(/[/\\:*?"<>|]/g, '_')
|
||||||
res.fileName = fileName
|
res.fileName = fileName
|
||||||
filePath = path.join(TEMP_DIR, uuidv4() + fileName)
|
filePath = path.join(TEMP_DIR, uuidv4() + fileName)
|
||||||
fs.writeFileSync(filePath, buffer)
|
fs.writeFileSync(filePath, buffer)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user