Skip to main content

DxUpload.PauseAllFilesUpload() Method

Pauses upload of all files to the server.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public void PauseAllFilesUpload()

Remarks

If chunk upload is enabled, users can click the pause button to pause file upload. Handle the FileUploadPaused event to respond to this action.

Upload - Pause a File Upload

Use the PauseAllFilesUpload method to pause upload of all files in code. The snippet below allows users to upload multiple files and displays a button that pauses all files upload on click.

<DxUpload ChunkSize="1000000"
          SelectedFilesChanged="@SelectedFilesChanged" 
          AllowMultiFileUpload="true"
          @ref="MyUpload" >
</DxUpload>

<DxButton Text="Pause Upload of All Files" Click=OnButtonClick />

@code {
    bool UploadVisible { get; set; } = false;
    IEnumerable<UploadFileInfo> Files { get; set; }
    DxUpload MyUpload { get; set; }

    protected void SelectedFilesChanged(IEnumerable<UploadFileInfo> files) {
        Files = files;
        UploadVisible = files.ToList().Count > 0;

        InvokeAsync(StateHasChanged);
    }

    void OnButtonClick(){
        MyUpload.PauselAllFilesUpload();
    }
}

To pause upload of the specified file or multiple files, use the PauseFileUpload or PauseFilesUpload method, respectively.

See Also