From af56564a0d0c807e817cca59510db71c02e0bd0f Mon Sep 17 00:00:00 2001 From: Jaehyeon Kim <65964601+Jaehyeon1020@users.noreply.github.com> Date: Mon, 1 Apr 2024 12:07:09 +0000 Subject: [PATCH] chore(be): remove file extension --- apps/backend/apps/admin/src/problem/problem.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/backend/apps/admin/src/problem/problem.service.ts b/apps/backend/apps/admin/src/problem/problem.service.ts index 570fa73a39..c850f72239 100644 --- a/apps/backend/apps/admin/src/problem/problem.service.ts +++ b/apps/backend/apps/admin/src/problem/problem.service.ts @@ -254,8 +254,8 @@ export class ProblemService { } async uploadImage(input: UploadFileInput) { - const { filename, mimetype, createReadStream } = await input.file - const newFilename = randomUUID() + '.' + (filename.split('.').pop() || '') // 확장자 + const { mimetype, createReadStream } = await input.file + const newFilename = randomUUID() if (!mimetype.includes('image/')) { throw new UnprocessableDataException('Only image files can be accepted')