Skip to main content

DxUpload.MaxFileSize Property

Specifies the maximum file size in bytes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[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