Bugfix/Address file name with special chars (#3496)

address file name with special chars
This commit is contained in:
Henry Heng
2024-11-09 15:21:09 +00:00
committed by GitHub
parent 0153735704
commit 1e2dc03527
6 changed files with 14 additions and 3 deletions
@@ -140,6 +140,8 @@ const uploadFilesToAssistantVectorStore = async (req: Request, res: Response, ne
if (Array.isArray(files)) {
for (const file of files) {
// Address file name with special characters: https://github.com/expressjs/multer/issues/1104
file.originalname = Buffer.from(file.originalname, 'latin1').toString('utf8')
uploadFiles.push({
filePath: file.path,
fileName: file.originalname
@@ -81,6 +81,8 @@ const uploadAssistantFiles = async (req: Request, res: Response, next: NextFunct
if (Array.isArray(files)) {
for (const file of files) {
// Address file name with special characters: https://github.com/expressjs/multer/issues/1104
file.originalname = Buffer.from(file.originalname, 'latin1').toString('utf8')
uploadFiles.push({
filePath: file.path,
fileName: file.originalname