From 5d4b42471e2f47e13841c88288bc3a63a97f75c8 Mon Sep 17 00:00:00 2001 From: Ashish Date: Wed, 18 Dec 2024 16:21:29 -0800 Subject: [PATCH] encode file name --- .../route-controllers/student/student.controller.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/packages/backend/apps/api/src/route-controllers/student/student.controller.service.ts b/sources/packages/backend/apps/api/src/route-controllers/student/student.controller.service.ts index c9bc34b97d..fdcbbad7d8 100644 --- a/sources/packages/backend/apps/api/src/route-controllers/student/student.controller.service.ts +++ b/sources/packages/backend/apps/api/src/route-controllers/student/student.controller.service.ts @@ -154,9 +154,11 @@ export class StudentControllerService { ); } + const encodedFileName = encodeURIComponent(studentFile.fileName); + response.setHeader( "Content-Disposition", - `attachment; filename=${studentFile.fileName}`, + `attachment; filename*=UTF-8''${encodedFileName}`, ); try {