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.MaxFileSize Property

Specifies the maximum file size in bytes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public int MaxFileSize { get; set; }

#Property Value

Type Description
Int32

An integer value that specifies the maximum file size in bytes.

#Remarks

Use the MaxFileSize and MinFileSize properties to limit an uploaded file’s size. The Upload component validates the file size on the client side and displays an error message if validation fails.

<DxUpload Name="myFile" 
          UploadUrl="https://localhost:10000/api/Upload/Upload/"
          MaxFileSize="4000000"
          MinFileSize="400">
</DxUpload>

Upload Size Validation

You can also use the following Upload properties to validate uploaded files on the client:

  • AcceptedFileTypes - Specifies a file type (MIME type) or multiple types (separated by a comma) that the Upload component accepts.
  • AllowedFileExtensions - Specifies file extensions (an array) that the Upload component accepts.

For more information on the server-side validation, refer to Server-Side Validation.

Run Demo: Upload - Validation

See Also