With latest Rubaxa library, this works by doing as below - Thanks to rubaXa for helping in git
Changes in onFilePrepare
$('#multiupload').fileapi({
url: "url",
data: ({'a':'A'}),
clearOnComplete: true,
multiple: true,
elements: {
ctrl: { upload: '.js-upload' },
emptyQueue: { hide: '.js-upload' },
list: '.js-files',
name: '.js-name',
size: '.js-size',
file: {
tpl: '.js-file-tpl',
preview: {
el: '.b-thumb__preview',
width: 80,
height: 80
},
upload: { show: '.progress', hide: '.b-thumb__rotate' },
complete: { hide: '.progress' },
progress: '.progress .bar'
}
},
onFilePrepare : function(evt,ui) {
//pass more data dynamically
ui.options.data.b = 'B';
},
onComplete : function (evt, ui) {
//read ajax data returned
var data = JSON.parse(ui.xhr.response);
console.log(ui.xhr.options);
}
});