Currently when I try to import more than 10 files in Blazor WebAssembly with
<InputFile OnChange="OnInputFileChange" />
I am greeted with the following exception
Uncaught (in promise) Error: System.InvalidOperationException: The maximum number of files accepted is 10, but 12 were supplied.
at Microsoft.AspNetCore.Components.Forms.InputFileChangeEventArgs.GetMultipleFiles(:5001/ic/c/Int32 maximumFileCount)
at AI.Play.Components.ClassModifyView.OnInputFileChange(:5001/ic/c/InputFileChangeEventArgs e) in C:\Users\shive\Desktop\test\AI.Play\AI.Play\Components\ClassModifyView.razor:line 76
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(:5001/ic/c/Task task)
also for some reasons files more than ~512000 Bytes size fails to import.
You can pass the maximumFileCount to GetMultipleFiles() as a parameter.
https://github.com/dotnet/aspnetcore/blob/e0467560e11a739897521326b543e9652a4edb77/src/Components/Web/src/Forms/InputFile/InputFileChangeEventArgs.cs#L47
Also when reading a file with OpenReadStream you can pass the maxAllowedSize:
https://github.com/dotnet/aspnetcore/blob/e0467560e11a739897521326b543e9652a4edb77/src/Components/Web/src/Forms/InputFile/IBrowserFile.cs#L60
@sps014 thanks for contacting us.
@campersau answer is correct, if you want a value different than the defaults, you need to be explicit about it.
@campersau , @javiercn Thanks it, helped