fix: http download filename special character

This commit is contained in:
linyuchen 2024-05-05 20:06:07 +08:00
parent ce31052661
commit e9d43a9449

View File

@ -176,6 +176,7 @@ export async function uri2local(uri: string, fileName: string = null): Promise<U
// res.ext = pathInfo.ext
}
}
fileName = fileName.replace(/[/\\:*?"<>|]/g, '_')
res.fileName = fileName
filePath = path.join(TEMP_DIR, uuidv4() + fileName)
fs.writeFileSync(filePath, buffer)