Ashutosh_Task#513 #96

Merged
ashutosh.nehete merged 58 commits from Ashutosh_Task#513 into Issues_June_3W 2025-06-28 04:27:28 +00:00
Showing only changes of commit 39378f3a88 - Show all commits

View File

@ -707,7 +707,16 @@ namespace MarcoBMS.Services.Controllers
if (string.IsNullOrEmpty(Image.Base64Data))
return BadRequest(ApiResponse<object>.ErrorResponse("Base64 data is missing", "Base64 data is missing", 400));
objectKey = await _s3Service.UploadFileAsync(Image.Base64Data, TenantId, "attendance");
//If base64 has a data URI prefix, strip it
var base64 = Image.Base64Data.Contains(",")
? Image.Base64Data.Substring(Image.Base64Data.IndexOf(",") + 1)
: Image.Base64Data;
string fileType = _s3Service.GetContentTypeFromBase64(base64);
string fileName = _s3Service.GenerateFileName(fileType, TenantId, "attendance");
string objectKey = $"tenant-{TenantId}/Employee/{recordAttendanceDot.EmployeeID}/Attendance/{fileName}";
await _s3Service.UploadFileAsync(base64, fileType, objectKey);
preSignedUrl = _s3Service.GeneratePreSignedUrlAsync(objectKey);
document = new Document
@ -722,6 +731,7 @@ namespace MarcoBMS.Services.Controllers
};
_context.Documents.Add(document);
await _context.SaveChangesAsync();
}