DxUploadBase.FileUploadError Event

Fires if an error occurs during file upload.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.dll

Declaration

[Parameter]
public Action<FileUploadErrorEventArgs> FileUploadError { get; set; }

Event Data

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

Property Description
FileInfo Returns information about a file. Inherited from FileUploadEventArgs.
RequestInfo Returns information about a request's response.

Remarks

The FileUploadError event occurs if a file was not uploaded to the server because of an error. If a file was uploaded successfully, the FileUploaded event occurs.

<DxUpload Name="myFile" UploadUrl="https://localhost:10000/api/Upload/UploadFile/" 
          FileUploadError="@OnFileUploadError"
          ShowFileList="false">
</DxUpload>

@code {
    void OnFileUploadError(FileUploadErrorEventArgs e) {
        // Write your code here. For instance, show an information message.
        string message = "The " + e.FileInfo.Name + " file was not uploaded. Error:" + e.RequestInfo.Status;
        ShowMyMessage(message);
    }
}
See Also