Skip to main content

DxUpload.FileUploadStarted Event

Fires when the file upload starts.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v26.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback<FileUploadEventArgs> FileUploadStarted { get; set; }

Event Data

The FileUploadStarted event's data class is FileUploadEventArgs. The following properties provide information specific to this event:

Property Description
FileInfo Returns information about a file.

Remarks

The FileUploadStarted event fires after the FileUploadStart event if the file upload operation is not cancelled.

Note that the following code snippet uses Bootstrap classes. To render elements correctly, enable the UseBootstrapStyles option in theme settings.

<DxUpload Name="myFile"
          UploadUrl="https://localhost:10000/api/Upload/Upload/" 
          FileUploadStarted="@OnFileUploadStarted" />

<div class="alert alert-info @(MessageVisible? " visible" : " invisible")">
    @MyMessage
</div>

@code {
    bool MessageVisible { get; set; } = false;
    string MyMessage { get; set; } = "";

    void OnFileUploadStarted(FileUploadEventArgs e) {
        MyMessage = "Upload of the " + e.FileInfo.Name + " file was started.";
        MessageVisible = true;
        InvokeAsync(StateHasChanged);
    }
}

File Upload Started

See Also