Add confirm dialog to remove the files

17 Feb 20222 minutes to read

You can customize the uploader control using confirm dialog before removing the files.
Here, ej2 dialog is used as confirm dialog. Refer to the following example.

    var asyncSettings = new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = "", RemoveUrl = "" };
<div class="control_wrapper">
    <ejs-uploader id="UploadFiles" removing="onremove" asyncSettings="@asyncSettings">
    <ejs-dialog id="dialog" target="body" visible="false" width="250px" content="Confirm to remove the file?">
            <e-dialog-dialogbutton buttonModel="ViewBag.button" click="Close"></e-dialog-dialogbutton>
            <e-dialog-dialogbutton buttonModel="ViewBag.button1" click="onClick"></e-dialog-dialogbutton>

    var removeFile = [], dialog;

    window.onload = function () {
        dialog = document.getElementById("dialog").ej2_instances[0];

    function onremove(args) {
        emoveFile = [];
        args.cancel = true;

    function onClick(args) {
        var uploadObj = document.getElementById("UploadFiles").ej2_instances[0];
        uploadObj.remove(removeFile[0], false, true);

    function Close() {
.control_wrapper {
    max-width: 400px;
    margin: 0 auto;

You can also explore ASP.NET Core File Upload feature tour page for its groundbreaking features. You can also explore our ASP.NET Core File Upload example to understand how to browse the files which you want to upload to the server.