Achieve file upload programmatically

21 Dec 20222 minutes to read

You can upload a file programmatically using upload method. The selected files data, get from getFilesData public method in uploader.

The upload method behaves differently based on its arguments.

  • If this method receives any files as arguments, those files only start to upload.
  • If it has no argument then all the selected files are will start to upload.
    var asyncSettings = new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = "", RemoveUrl = "" };

<div class="col-lg-8 control-section">
    <div class="control_wrapper">
        <ejs-uploader id="UploadFiles" asyncSettings="@asyncSettings" autoUpload="false">
    <span style=' padding-left: 40px; margin-top: 30px'>
        <button id='first' class='e-btn e-control'>Upload 0th File</button>
    <span style=' padding-left: 40px; margin-top: 30px'>
        <button id='full' class='e-btn e-control'>Upload All Files</button>

    window.onload = function () {
        var uploadObj = document.getElementById("UploadFiles").ej2_instances[0];
        document.getElementById('first').onclick = (args) => {

        document.getElementById('full').onclick = (args) => {
.control_wrapper {
    max-width: 500px;
    margin: auto;

.e-upload {
    width: 100%;
    position: relative;
    margin-top: 15px;
    margin-bottom: 15px;

.e-upload-actions {
    display: none;

.e-btn {
    text-transform: 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.