Skip to content

Commit

Permalink
Merge pull request #84 from Brixel/feature/#52-maxfilesize
Browse files Browse the repository at this point in the history
feat: Override max file size limit for file upload #52
  • Loading branch information
BerendWouters authored Aug 23, 2022
2 parents ea26907 + cd8bc29 commit 9424efb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Web/Pages/Transactions/TransactionForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
}

MudDatePicker _picker = new();
private int _maxAllowedSize = 1024 * 1024 * 10;

private async Task<IEnumerable<AutocompleteCounterparty>> SearchForMembers(string searchString)
{
Expand Down Expand Up @@ -350,7 +351,7 @@
var path = Path.Combine(directory, trustedFileNameForFileStorage);

await using FileStream fs = new(path, FileMode.Create);
await file.OpenReadStream().CopyToAsync(fs);
await file.OpenReadStream(maxAllowedSize:_maxAllowedSize).CopyToAsync(fs);
var transaction = new TransactionAttachment(file.Name, file.ContentType, path);
Transaction.TransactionAttachments.Add(transaction);
}
Expand Down

0 comments on commit 9424efb

Please sign in to comment.