working ish slow OTA
This commit is contained in:
parent
0b1ca17351
commit
6686c1bfe0
5 changed files with 306 additions and 283 deletions
|
@ -31,7 +31,7 @@
|
|||
reader.onload = function (e) {
|
||||
var data = new Uint8Array(e.target.result);
|
||||
var size = data.length;
|
||||
var chunkSize = 4096;
|
||||
var chunkSize = 128;
|
||||
var index = 0;
|
||||
|
||||
$.ajax({
|
||||
|
@ -52,6 +52,10 @@
|
|||
contentType: 'application/json',
|
||||
success: function () {
|
||||
index += chunkSize;
|
||||
// Update the progress bar
|
||||
var percent = Math.floor(index / size * 100);
|
||||
$('#bar').css('width', percent + '%');
|
||||
$('#prg').html("Uploading: " + percent + ' (' + index + '/' + size + ')');
|
||||
sendNextChunk();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue