+
Upload Status:
+
Chunk Upload: @ChunkStatus
+
Pause/Resume: @PauseResumeStatus
+
Final Status: @FinalStatus
+
+
@code {
- private void OnResumeHandler(PauseResumeEventArgs args)
+ private string ChunkStatus = "Waiting...";
+ private string PauseResumeStatus = "Waiting...";
+ private string FinalStatus = "Waiting...";
+
+ private void OnChunkUploadStartHandler(UploadingEventArgs args)
{
- // Here, you can customize your code.
+ ChunkStatus = $"Started chunk upload for {args.FileData.Name}";
}
- private void PausedHandler(PauseResumeEventArgs args)
+
+ private void OnChunkSuccessHandler(SuccessEventArgs args)
{
- // Here, you can customize your code.
+ ChunkStatus = $"Chunk upload successful for {args.File?.Name}, Response: {args.Response}";
}
-}
-```
-
-
-
-## Cancel upload
-
-The uploader component allows you to cancel the uploading file. This can be achieved by clicking the cancel icon or using the `Cancel` method. The [Canceling](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.UploaderModel.html#Syncfusion_Blazor_Inputs_UploaderModel_Canceling) event will be fired whenever the file upload request is canceled. While canceling the upload request, the partially uploaded file is removed from the server.
+ private void OnChunkFailureHandler(Syncfusion.Blazor.Inputs.FailureEventArgs args)
+ {
+ ChunkStatus = $"Chunk upload failed for {args.File?.Name}, Error: {args.StatusText}";
+ }
-When the request fails, the pause icon is changed to retry icon. By clicking the retry icon, sends the failed chunk request again to the server and upload started from where it is failed. You can retry the canceled upload request again using retry UI or `Retry` methods. But, if you retry this, the file upload action again starts from initial.
+ private void PausedHandler(PauseResumeEventArgs args)
+ {
+ PauseResumeStatus = $"File {args.File?.Name} paused.";
+ }
-The following example explains about chunk upload with cancel support.
+ private void OnResumeHandler(PauseResumeEventArgs args)
+ {
+ PauseResumeStatus = $"File {args.File?.Name} resumed.";
+ }
-`SaveUrl` and `RemoveUrl` actions are explained in this [link](./chunk-upload#save-and-remove-action-for-blazor-aspnet-core-hosted-application).
+ private void SuccessHandler(SuccessEventArgs args)
+ {
+ FinalStatus = $"File {args.File?.Name} uploaded successfully. Response: {args.Response}";
+ }
-```cshtml
-@using Syncfusion.Blazor.Inputs
+ private void FailureHandler(Syncfusion.Blazor.Inputs.FailureEventArgs args)
+ {
+ FinalStatus = $"File upload failed for {args.File?.Name}. Error: {args.StatusText}";
+ }
+}
-