Back to Devexpress

DxUpload.MaxFileCount Property

blazor-devexpress-dot-blazor-dot-dxupload-de7db07c.md

latest2.1 KB
Original Source

DxUpload.MaxFileCount Property

Specifies the maximum number of files a user can select to upload.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(1000)]
[Parameter]
public int MaxFileCount { get; set; }

Property Value

TypeDefaultDescription
Int321000

The maximum number of files to upload.

|

Remarks

You can enable users to upload multiple files (set the AllowMultiFileUpload to true). To specify the maximum number of files to upload, use the MaxFileCount property. A user can select files several times, but the total number of files can not exceed the limit.

The MaxFileCount property’s default value is 1000. We recommend that limit for correct operation of the DxUpload component. If you need to reset the limit and allow users to select any number of files, set the property to 0 (zero).

The following code snippet sets the limit to 500 files.

razor
<DxUpload UploadUrl="https://localhost:10000/api/Upload/Upload/"
          AllowMultiFileUpload="true"
          MaxFileCount="500">
</DxUpload>

In case the component reaches its limit, the user can remove uploaded files and submit other files. You can also remove files in code. Use the following methods: RemoveFile(UploadFileInfo), RemoveFiles(IEnumerable<UploadFileInfo>), RemoveAllFiles().

See Also

DxUpload Class

DxUpload Members

DevExpress.Blazor Namespace