From f96b18d2b480111dc66f496792450d1e090973d5 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 19 Jan 2023 19:46:58 +0800 Subject: [PATCH] feat(nocodb): remove original name from file name --- packages/nocodb/src/lib/meta/api/attachmentApis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/lib/meta/api/attachmentApis.ts b/packages/nocodb/src/lib/meta/api/attachmentApis.ts index e6a13a70ee..df6738763c 100644 --- a/packages/nocodb/src/lib/meta/api/attachmentApis.ts +++ b/packages/nocodb/src/lib/meta/api/attachmentApis.ts @@ -52,7 +52,7 @@ export async function upload(req: Request, res: Response) { const attachments = await Promise.all( (req as any).files?.map(async (file) => { - const fileName = `${nanoid(6)}_${file.originalname}`; + const fileName = `${nanoid(18)}${path.extname(file.originalname)}`; let url = await storageAdapter.fileCreate( slash(path.join(destPath, fileName)),