Skip to content

Instantly share code, notes, and snippets.

@dodolboks
Created January 5, 2014 19:08
Show Gist options
  • Save dodolboks/8272467 to your computer and use it in GitHub Desktop.
Save dodolboks/8272467 to your computer and use it in GitHub Desktop.
example add extra data in Jquery File Upload - https://blueimp.github.io/jQuery-File-Upload/‎
$("#fileupload").fileupload({
dataType: 'json',
url:'/kelas/{{ kelas.id }}/new/image/',
add: function (e, data) {
no_img = 1
$("#btnSubmit").click(function () {
title = $("input#titleimg").val();
data.formData = {title:title, no_img:no_img};
data.submit();
no_img += 1
});
},
done: function (e, data) {
$('#progress .bar').css('width', '0%');
location = url;
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .bar').css({'width':progress + '%', 'float':'left'});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment