Skip to content

Commit

Permalink
Fix for right to work file size (referencing consent)
Browse files Browse the repository at this point in the history
  • Loading branch information
samgibsonmoj authored and carlsixsmith-moj committed Sep 12, 2024
1 parent 6c7ee72 commit f0fee5e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task<Result<string>> 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);
Expand Down Expand Up @@ -134,7 +134,7 @@ private async Task<bool> 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))
Expand Down

0 comments on commit f0fee5e

Please sign in to comment.