Answer:
In the file uploader component we can validate the selected file size and extension using the AllowedExtensions, MinFileSize and MaxFileSize when you click on the browse button. Please find the code snippet and test sample below for reference.
<SfUploader ID="file" @ref="UploadObj" AutoUpload="false" HtmlAttributes="@htmlAttr" AllowedExtensions=".doc, .docx, .xls, .xlsx" MinFileSize=10000 MaxFileSize=1000000>
<UploaderEvents ValueChange="OnChange">UploaderEvents>
SfUploader> |
Find the sample for validate upload fields to a file using the Blazor File Upload from here.