Search results

Check the MIME type of file before upload it

By using uploading event, you can get the file MIME type before uploading it to server. In the below sample, file MIME type is shown in the alert box before file start to upload.

<div class="col-lg-8 control-section">
    <div class="control_wrapper">
        @Html.EJS().Uploader("UploadFiles").Uploading("onBeforeUpload").AutoUpload(false).DropArea(".control-fluid").AsyncSettings(new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = "", RemoveUrl = "" }).Render()


    function onBeforeUpload(args) {
        // get the file MIME type
        alert("File MIME type is: " + args.fileData.rawFile.type);

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();
.control_wrapper {
        max-width: 500px;
        margin: auto;

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