DxFileInput.AllowMultiFileUpload Property
Specifies whether users can add multiple files to the file list simultaneously.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public bool AllowMultiFileUpload { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
Remarks
Once a user selects files in the Open dialog or drags files onto a drop zone, the File Input component adds these files to the file list. In Instant
upload mode (default), the component starts to upload a file once it appears in the file list. In OnClick
upload mode, the File Input starts to upload a file once a user clicks an upload button.
Enable the AllowMultiFileUpload
property to allow users to add multiple files to the file list simultaneously. The MaxFileCount
property specifies the maximum file list size. When the file list reaches its size limit, users can add new files only once they remove one or more uploaded files.
The following example allows users to add multiple files to the file list:
<DxFileInput FilesUploading="OnFilesUploading" AllowMultiFileUpload="true" MaxFileCount="10" />
@code {
async Task OnFilesUploading(FilesUploadingEventArgs args) {
foreach (var file in args.Files) {
/* The following code is intended for demonstration purposes only.
Do not read a stream directly in memory to avoid performance and security-related issues. */
using var stream = new System.IO.MemoryStream();
await file.OpenReadStream(file.Size).CopyToAsync(stream);
}
}
}