New to Kendo UI for jQuery? Download free 30-day trial

Serialize Form Data during Async Upload


Product Progress® Kendo UI® Upload for jQuery
Operating System Windows 10 64bit
Visual Studio Version Visual Studio 2017
Preferred Language JavaScript


How can I include a collection of form fields as metadata during asynchronous uploads?


The output from the commonly used jQuery.serializeArray helper is not directly usable in the upload event and needs to be processed. The following example demonstrates how to achieve this.

    <form id="form"/>
      <input type="text" name="name1" value="value1" />
      <input type="text" name="name2" value="value2" />

    <input type="file" id="files" />

        async: {
        upload: function (e) {
          var data = {};
          var form = $('#form').serializeArray();

          $.each(form, function() {
              data[] = this.value;

 = data;

The network request is expected to look like the one shown below.

Content-Disposition: form-data; name="name1"

Content-Disposition: form-data; name="name2"

Content-Disposition: form-data; name=""; filename="filename.txt"
Content-Type: text/plain


See Also

In this article