From 3aaa18ee59ebae21859df52c50adeb637b887680 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Thu, 25 Feb 2021 18:33:26 +0800 Subject: [PATCH] progress in Calculate sha1 --- theme/classic.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/theme/classic.html b/theme/classic.html index b8f6ac4..202f3eb 100644 --- a/theme/classic.html +++ b/theme/classic.html @@ -1086,9 +1086,10 @@ return; }*/ var upbigfilename = encodeURIComponent((file.webkitRelativePath||file.name)); - td2.innerHTML='计算SHA1 ...'; var reader = new FileReader(); - reader.readAsArrayBuffer(file); + reader.onprogress = function(e) { + td2.innerText = '计算SHA1... ' + (e.loaded*100/file.size).toFixed(2) + " %"; + } reader.onload = function(e) { var filesha1 = sha1(this.result); @@ -1146,6 +1147,7 @@ xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified + '&filesha1=' + filesha1 + '&chunksize=' + chunksize); } } + reader.readAsArrayBuffer(file); } uploadbuttonshow(); }