Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

C#
[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.

Upload - File extension validation

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.

Run Demo: Upload - Validation

See Also