Skip to content

FluentInputFile : how can i catch the error when The maximum number of files accepted #3204

@vnbaaij

Description

@vnbaaij

Discussed in #3202

Originally posted by jobouillon January 17, 2025

When i upload more thant 4 i got this error in the console but i would like to intercept and show it on screen.

How can i do that?

You can reproduce with the demo site https://www.fluentui-blazor.net/InputFile

I thougth i could use OnFileError but it's not working for now.

OnFileError="@ErrorAttachmentHandling" OnCompleted="@OnAttachmentCompletedAsync"

Uncaught (in promise) Error: System.ApplicationException: The maximum number of files accepted is 4, but 6 were supplied. at Microsoft.FluentUI.AspNetCore.Components.FluentInputFile.OnUploadFilesHandlerAsync(InputFileChangeEventArgs e) at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) at v.endInvokeDotNetFromJS (blazor.webassembly.js:1:3158) at Object.Qt [as endInvokeDotNetFromJS] (blazor.webassembly.js:1:56145) at invoke-js.ts:319:31 at Fc (invoke-js.ts:78:5) at 00b5922a:0x1f0d9 at 00b5922a:0x1c7c3 at 00b5922a:0xea10 at 00b5922a:0x1eb99 at 00b5922a:0x1fd00 at 00b5922a:0xc791

Metadata

Metadata

Assignees

No one assigned

    Labels

    community:contributionIssue will/can be addressed by community contribution

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions