From e573d085d386d425c9934c53163ab768f2ba2221 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Sat, 12 Aug 2023 23:59:31 +0800 Subject: [PATCH] refactor: buffer form attachment file name (#2429) --- packages/plugins/file-manager/src/server/actions/attachments.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugins/file-manager/src/server/actions/attachments.ts b/packages/plugins/file-manager/src/server/actions/attachments.ts index 327c89e19..bcefb8edf 100644 --- a/packages/plugins/file-manager/src/server/actions/attachments.ts +++ b/packages/plugins/file-manager/src/server/actions/attachments.ts @@ -32,7 +32,7 @@ function getFileData(ctx: Context) { const urlPath = storage.path ? storage.path.replace(/^([^/])/, '/$1') : ''; return { - title: file.originalname.replace(extname, ''), + title: Buffer.from(file.originalname, 'latin1').toString('utf8').replace(extname, ''), filename, extname, // TODO(feature): 暂时两者相同,后面 storage.path 模版化以后,这里只是 file 实际的 path