From ee7a661d38640fb8f80f82b2035ba11202ec0967 Mon Sep 17 00:00:00 2001 From: AnandaTon <125332905+anandaAiemvong@users.noreply.github.com> Date: Mon, 3 Apr 2023 11:21:26 +0700 Subject: [PATCH] Update CandidateController.cs --- Controllers/CandidateController.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Controllers/CandidateController.cs b/Controllers/CandidateController.cs index 6b50211..4f6c51b 100644 --- a/Controllers/CandidateController.cs +++ b/Controllers/CandidateController.cs @@ -795,7 +795,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers { var doc = await _candidateService.GetsAsyncProfileImage(examId); - return Success(doc); + var file_data = await _minioService.DownloadFileAsync(doc); + Response.Headers["Content-Disposition"] = $"inline; filename={file_data.FileName}"; + var ret = new FileContentResult(file_data.FileContent, file_data.FileType) + { + FileDownloadName = file_data.FileName + }; + + return ret; } catch (Exception ex) { @@ -821,7 +828,14 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers { var doc = await _candidateService.GetsAsyncPaymentImg(examId); - return Success(doc); + var file_data = await _minioService.DownloadFileAsync(doc); + Response.Headers["Content-Disposition"] = $"inline; filename={file_data.FileName}"; + var ret = new FileContentResult(file_data.FileContent, file_data.FileType) + { + FileDownloadName = file_data.FileName + }; + + return ret; } catch (Exception ex) {