From f0fee5eba4a9b3657343be0158f0073d2c888f96 Mon Sep 17 00:00:00 2001 From: samgibsonmoj Date: Thu, 12 Sep 2024 12:06:04 +0100 Subject: [PATCH] Fix for right to work file size (referencing consent) --- .../Features/Participants/Commands/AddRightToWork.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Application/Features/Participants/Commands/AddRightToWork.cs b/src/Application/Features/Participants/Commands/AddRightToWork.cs index d93694e0..7d422b9f 100644 --- a/src/Application/Features/Participants/Commands/AddRightToWork.cs +++ b/src/Application/Features/Participants/Commands/AddRightToWork.cs @@ -49,7 +49,7 @@ public async Task> Handle(Command request, CancellationToken canc $"Right to work evidence for {request.ParticipantId}", DocumentType.PDF); - long maxSizeBytes = Convert.ToInt64(ByteSize.FromMegabytes(Infrastructure.Constants.Documents.Consent.MaximumSizeInMegabytes).Bytes); + long maxSizeBytes = Convert.ToInt64(ByteSize.FromMegabytes(Infrastructure.Constants.Documents.RightToWork.MaximumSizeInMegabytes).Bytes); await using var stream = request.Document.OpenReadStream(maxSizeBytes); using var memoryStream = new MemoryStream(); await stream.CopyToAsync(memoryStream, cancellationToken); @@ -134,7 +134,7 @@ private async Task BePdfFile(IBrowserFile? file, CancellationToken cancell if (file.ContentType != "application/pdf") return false; - long maxSizeBytes = Convert.ToInt64(ByteSize.FromMegabytes(Infrastructure.Constants.Documents.Consent.MaximumSizeInMegabytes).Bytes); + long maxSizeBytes = Convert.ToInt64(ByteSize.FromMegabytes(Infrastructure.Constants.Documents.RightToWork.MaximumSizeInMegabytes).Bytes); // Check file signature (magic numbers) using (var stream = file.OpenReadStream(maxSizeBytes))