Search results

Add additional data on upload

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

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

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