code: function (data) {
              var that = this;
              if (!data || this.options.disabled) {
                  return;
              }
              if (data.fileInput && !data.files) {
                  this._getFileInputFiles(data.fileInput).always(function (files) {
                      data.files = files;
                      that._onAdd(null, data);
                  });
              } else {
                  data.files = $.makeArray(data.files);
                  this._onAdd(null, data);
              }
          }
docs: This method is exposed to the widget API and allows adding files using the fileupload API. The data parameter accepts an object which must have a files property and can contain additional options: .fileupload('add', {files: filesList});