Add additional data on upload

21 Dec 20221 minute to read

The uploader control allows to add additional data on file upload, which is used to get in the server-side.
By using uploading event and its customFormData argument, this behavior can be achieved.

<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;
}

NOTE

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