DxUpload.AllowedFileExtensions Property
Specifies file extensions that the Upload component accepts.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public List<string> AllowedFileExtensions { get; set; }
Property Value
Type | Description |
---|---|
List<String> | A list of allowed file extensions. |
Remarks
Use the AllowedFileExtensions
property to restrict extensions of files that users can upload.
<DxUpload Name="myFile" UploadUrl="https://localhost:10000/api/Upload/Upload/"
AllowedFileExtensions="@(new List<string> { ".jpg", ".jpeg", ".gif", ".png" })">
</DxUpload>
Once a user selected or dropped a file, the Upload validates the file’s extension on the client. If the extension is not allowed, the Upload displays an error.
Note
The AllowedFileExtensions
property does not affect the Open File dialog’s filter.
Use the AcceptedFileTypes property to filter files in the Open File dialog. You can specify allowed file types (image, video, etc.) and/or individual file extensions.
For more information on server-side validation, refer to Server-Side Validation.