Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 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

    DxFileInput.AllowMultiFileUpload Property

    Specifies whether users can add multiple files to the file list simultaneously.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    #Declaration

    C#
    [Parameter]
    public bool AllowMultiFileUpload { get; set; }

    #Property Value

    Type Description
    Boolean

    true to allow users to add multiple files to the file list simultaneously; otherwise, false.

    #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:

    Razor
    <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);
            }
        }
    }
    

    Run Demo: File Input - Multiple File Selection

    See Also