code: function (data) {
              if (data && !this.options.disabled) {
                  if (data.fileInput && !data.files) {
                      var that = this,
                          dfd = $.Deferred(),
                          promise = dfd.promise(),
                          jqXHR,
                          aborted;
                      promise.abort = function () {
                          aborted = true;
                          if (jqXHR) {
                              return jqXHR.abort();
                          }
                          dfd.reject(null, 'abort', 'abort');
                          return promise;
                      };
                      this._getFileInputFiles(data.fileInput).always(
                          function (files) {
                              if (aborted) {
                                  return;
                              }
                              data.files = files;
                              jqXHR = that._onSend(null, data).then(
                                  function (result, textStatus, jqXHR) {
                                      dfd.resolve(result, textStatus, jqXHR);
                                  },
                                  function (jqXHR, textStatus, errorThrown) {
                                      dfd.reject(jqXHR, textStatus, errorThrown);
                                  }
                              );
                          }
                      );
                      return this._enhancePromise(promise);
                  }
                  data.files = $.makeArray(data.files);
                  if (data.files.length) {
                      return this._onSend(null, data);
                  }
              }
              return this._getXHRPromise(false, data && data.context);
          }
docs: This method is exposed to the widget API and allows sending files using the fileupload API. The data parameter accepts an object which must have a files or fileInput property and can contain additional options: .fileupload('send', {files: filesList}); The method returns a Promise object for the file upload call.