diff --git a/posting2.js b/posting2.js index 7d5c89f..266261f 100644 --- a/posting2.js +++ b/posting2.js @@ -23,6 +23,23 @@ } + var xhr=false; + + if(!options.hasOwnProperty("upload")) { + + xhr = $.ajaxSettings.xhr(); + xhr.upload.onprogress = function (event) { + + if(event.lengthComputable) { + + $("#loaded_n_total").html("Uploaded "+event.loaded+" bytes of "+event.total); + var percent = (event.loaded / event.total) * 100; + $("#progressBar").val(Math.round(percent)); + $("#status").html(Math.round(percent)+"% uploaded... please wait"); + + } + }; + } $(this).on('submit', function (e) {