fix: http download filename special character
This commit is contained in:
1 parent
8449b590df
commit
67b0a1ebf9
1 file changed
+1
@@ -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);
|
||||||
|
|||||||
Reference in new issue
Block a user