Blazor File Upload - File Validation
This example demonstrates how to validate files before uploading them to the server. Only document files (DOC, DOCX, XLS, XLSX) with a minimum size of "10 KB" and maximum size of "100 MB" are allowed to upload to the server.
The File Upload component allows you to validate the file's type and limit the file size using the following properties:
- AllowedExtensions - Specifies the file types allowed for upload.
- MinFileSize - Sets the minimum file size allowed.
- MaxFileSize - Sets the maximum file size allowed.
In this example, the backend service used in the saveUrl and removeUrl endpoints for saving and removing files is intended for demonstration purposes only. The uploaded files are subjected to thorough validation, including verification of file names and the application of security checks. Therefore, this service is not recommended for production use, and the configuration of a custom backend save and remove service is advised.
See also