Search results

Trigger Click Event of Input File from External Button in ASP.NET Core Uploader control

28 Oct 2021 / 1 minute to read

You can trigger the click event of input file from external button using click event of button. In the below sample, triggered click event of input file from Essential JavaScript 2 Button.

Copied to clipboard
    var asyncSettings = new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = "", RemoveUrl = "" };

<div class="col-lg-8 control-section">
    <div class="control_wrapper">
        <!-- Initialize Uploader -->
        <div id="dropArea">
            <span id="drop"> Drop image (JPG, PNG) files here or <button class='e-btn e-control' id="browse">Browse</button></span>
        <ejs-uploader id="UploadFiles" dropArea="#drop" asyncSettings="@asyncSettings">

    window.onload = function () {
        document.getElementById('browse').onclick = () => {
Copied to clipboard
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace EJ2CoreSampleBrowser.Controllers.TextBoxes
    public partial class UploaderController : Controller
        public ActionResult DefaultFunctionalities()
            return View();
Copied to clipboard
.control_wrapper {
        max-width: 500px;
        margin: auto;
    #dropArea {
        border: 1px dashed #c3c3cc;
        text-align: center;
        padding: 20px 0 10px;

    .e-file-select-wrap {
        display: none;

    .control_wrapper .e-upload .e-upload-drag-hover {
        margin: 0;

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.