From 93dad6e4e930b5b9c3e48aec6eb41ee4c470789a Mon Sep 17 00:00:00 2001 From: anthioikonomou Date: Tue, 12 Sep 2023 14:04:47 +0300 Subject: [PATCH 1/2] Fix original file name encoding --- modules/@themost/express/src/middleware.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/@themost/express/src/middleware.js b/modules/@themost/express/src/middleware.js index eae8521..cf10df4 100644 --- a/modules/@themost/express/src/middleware.js +++ b/modules/@themost/express/src/middleware.js @@ -1180,7 +1180,7 @@ function postEntitySetAction(options) { bufferedStream = fs.createReadStream(file.path); bufferedStream.contentEncoding = file.encoding; bufferedStream.contentType = file.mimetype; - bufferedStream.contentFileName = file.originalname; + bufferedStream.contentFileName = Buffer.from(file.originalname, 'latin1').toString('utf-8'); bufferedStream.on('close', () => { TraceUtils.debug(`(postEntitySetAction), Closing read stream, ${file.path}`); try { @@ -1547,7 +1547,7 @@ function postEntityAction(options) { bufferedStream = fs.createReadStream(file.path); bufferedStream.contentEncoding = file.encoding; bufferedStream.contentType = file.mimetype; - bufferedStream.contentFileName = file.originalname; + bufferedStream.contentFileName = Buffer.from(file.originalname, 'latin1').toString('utf-8'); bufferedStream.on('close', () => { TraceUtils.debug(`(postEntityAction), Closing read stream, ${file.path}`); try { From a4c3547cf71623dca0329100567769c534fe50f0 Mon Sep 17 00:00:00 2001 From: anthioikonomou Date: Tue, 12 Sep 2023 14:30:17 +0300 Subject: [PATCH 2/2] 1.6.2 --- modules/@themost/express/package-lock.json | 2 +- modules/@themost/express/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/@themost/express/package-lock.json b/modules/@themost/express/package-lock.json index 9e988b1..3b89be6 100644 --- a/modules/@themost/express/package-lock.json +++ b/modules/@themost/express/package-lock.json @@ -1,6 +1,6 @@ { "name": "@themost/express", - "version": "1.6.1", + "version": "1.6.2", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/modules/@themost/express/package.json b/modules/@themost/express/package.json index 787f5d9..caf42a8 100644 --- a/modules/@themost/express/package.json +++ b/modules/@themost/express/package.json @@ -1,6 +1,6 @@ { "name": "@themost/express", - "version": "1.6.1", + "version": "1.6.2", "description": "MOST Data ORM Express Middleware", "main": "dist/index.cjs.js", "module": "dist/index.esm.js",