Back to Devexpress

DxUpload.AllowPause Property

blazor-devexpress-dot-blazor-dot-dxupload-983ebfb3.md

latest2.7 KB
Original Source

DxUpload.AllowPause Property

Specifies whether users can pause file upload in chunk upload mode.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public bool AllowPause { get; set; }

Property Value

TypeDescription
Boolean

true to allow users to pause file upload; otherwise, false.

|

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.

To pause the file upload in code, use the following methods:

Users can then continue file upload.

Set the AllowPause property to false to hide the pause button during the upload process.

razor
<DxUpload Name="myFile" UploadUrl="https://localhost:10000/api/Upload/Upload/"
          AllowPause="false">
</DxUpload>
csharp
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BlazorDemo.AspNetCoreHost;
[Route("api/[controller]")]
[ApiController]
public class UploadController : ControllerBase {
    [HttpPost("[action]")]
    public ActionResult Upload(IFormFile myFile) {
        try {
            // Write code that saves the 'myFile' file.
            // Don't rely on or trust the FileName property without validation.
        } catch {
            return BadRequest();
        }
        return Ok();
    }
}

See Also

DxUpload Class

DxUpload Members

DevExpress.Blazor Namespace