Why is it that when I call FileReader"s onprogressAPI to set the progress, the upload will get stuck in the middle of the upload, and then finish it directly after a while?
question code is as follows:
var reader = new FileReader();
reader.onprogress = function(ev) {
setTimeout(function(){ hr.style.width = parseInt(ev.loaded*100 / ev.total) + "%"; }, 1)
pro.value = ev.loaded;
}
reader.readAsDataURL(upload.files[0]);
I want to change the progress bar according to the actual progress.