Created
January 5, 2014 19:08
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#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