From 64096211e243bd82586a996ff9e860b9121bf2b1 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Wed, 9 Mar 2022 14:03:23 +0800 Subject: [PATCH] rapid upload for aliyundrive (need bcmath) --- theme/classic.html | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/theme/classic.html b/theme/classic.html index e5e8796..a59a670 100644 --- a/theme/classic.html +++ b/theme/classic.html @@ -1160,7 +1160,37 @@ }// else console.log(Object.keys(uploading).length); } else clearInterval(uploadList); }, 1000); - //getuplink(i); + function CalcProof(file) { + return new Promise(function(resolve, reject){ + var xhr = new XMLHttpRequest(); + xhr.open("POST", '?action=upbigfile'); + xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8"); + xhr.setRequestHeader('x-requested-with', 'XMLHttpRequest'); + xhr.onload = function(e){ + var html; + if (xhr.status==200) { + //console.log(xhr.responseText); + var reader1 = new FileReader(); + var start = Number(xhr.responseText); + var end = start + 8; + if (file.size { + proof_code = a; + console.log('proof: ' + proof_code); + readblob(asize); + }, e => { + td2.innerHTML = e; + }); reader.onload = function(e){ td2.innerHTML=' SHA1: '+(asize*100/file.size).toFixed(2)+'%'; @@ -1267,7 +1305,7 @@ getuplink(i); }*/ } - xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified + '&filesha1=' + filesha1 + '&chunksize=' + chunksize + '&_admin=' + localStorage.getItem("admin")); + xhr1.send('upbigfilename='+ upbigfilename +'&filesize='+ file.size +'&filelastModified='+ file.lastModified + '&proof_code=' + proof_code + '&filesha1=' + filesha1 + '&chunksize=' + chunksize + '&_admin=' + localStorage.getItem("admin")); } } }