I have a very simple upload script, but it doesn't trigger the progress.. It only triggers the progress
method once and when the file is done it triggers complete
and prints done!
Chrome 58.0.3029.110 (64-bit)
Firefox 53.0.3 (32-bit)
Have also tried to upload larger files and still the progress
method is only triggered once
https://github.com/blueimp/jQuery-File-Upload
test
code
<!DOCTYPE html>
<html lang="da">
<head>
<meta charset="utf-8">
</head>
<body>
<script src="//code.jquery.com/jquery-3.2.1.min.js" integrity="sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f" crossorigin="anonymous"></script>
<script src="//code.jquery.com/ui/1.12.0/jquery-ui.min.js" integrity="sha256-eGE6blurk5sHj+rmkfsGYeKyZx3M4bG+ZlFyA7Kns7E=" crossorigin="anonymous"></script>
<script src="/upload/js/blueimp/jquery.fileupload.min.js"></script>
<form id="upload_form" enctype="multipart/form-data" method="post" action="/upload/">
<input id="upload_input" type="file" name="files[]">
<input type="hidden" name="send" value="1">
</form>
<div id="upload_console"></div>
<script>
'use strict';
$(function(){
var div = $('#upload_console')
$('#upload_form').fileupload({
fileInput : $('#upload_input'),
progress : function(e, data){
//console.log(data.loaded);
//console.log(parseInt(data.loaded / data.total * 100, 10));
div.append('<div>'+data.loaded+'</div>')
},
complete : function(e, data){
//console.log('done');
div.append('<div>done!</div>')
}
});
});
</script>
</body>
</html>