fix OOM Error
All checks were successful
Build & Deploy on Dev / build (push) Successful in 54s

This commit is contained in:
Suphonchai Phoonsawat 2026-05-15 16:37:14 +07:00
parent 9c2caa3f4a
commit 2b000cbd69
5 changed files with 95 additions and 63 deletions

View file

@ -72,14 +72,13 @@ namespace BMA.EHR.Recruit.Services
{
var id = Guid.NewGuid();
file.CopyTo(ms);
var fileBytes = ms.ToArray();
System.IO.MemoryStream filestream = new System.IO.MemoryStream(fileBytes);
ms.Position = 0; // Reset stream position for reading
var request = new PutObjectRequest
{
BucketName = _bucketName,
Key = id.ToString("D"),
InputStream = filestream,
InputStream = ms,
ContentType = file.ContentType,
CannedACL = S3CannedACL.PublicRead
};