How to add additional data on upload in ASP.NET MVC File Upload

26 Aug 20261 minute to read

The Uploader control allows you to add additional data when uploading files. Using the uploading event and its customFormData argument, you can send this data to the server. Refer to the following example,

<div class="control_wrapper">
    @Html.EJS().Uploader("fileupload").Uploading("onFileUpload").AsyncSettings(new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = "https://services.syncfusion.com/aspnet/production/api/FileUploader/Save", RemoveUrl = "https://services.syncfusion.com/aspnet/production/api/FileUploader/Remove" }).Render()
</div>

<script>
function onFileUpload(args) {
  args.customFormData = [{'name': 'Syncfusion INC'}];
}
</script>
.control_wrapper {
	max-width: 505px;
	margin: auto;
}

Explore the ASP.NET MVC File Upload feature tour page to discover its groundbreaking features. You can also check out our ASP.NET MVC File Upload example to see how to browse and select files for upload to the server.