Skip to content

Commit

Permalink
return md5 to browser to Calc bignumber
Browse files Browse the repository at this point in the history
  • Loading branch information
qkqpttgf authored Mar 16, 2022
1 parent 1b57164 commit 2b5a3e8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions disk/Aliyundrive.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,10 @@ public function bigfileupload($path)
$result = $this->fileComplete($_POST['fileid'], $_POST['uploadid'], json_decode($_POST['etag'], true));
return output(json_encode($this->files_format(json_decode($result['body'], true))), $result['stat']);
} else {
if (isset($_POST['CalcProof'])&&is_numeric($_POST['filesize'])) {
if (isset($_POST['CalcProof'])) {
return output(substr(md5($this->access_token), 0, 16), 200);
// Calc proof code
if (!function_exists('bcadd')) {
/*if (!function_exists('bcadd')) {
// no php-bcmath
return output(0, 200);
} else {
Expand All @@ -583,7 +584,7 @@ public function bigfileupload($path)
$o = bcmod($r, $i);
//return output(hexdec( substr(md5($this->access_token), 0, 16) ) . ' , ' . $r . ' / ' . $i . ' = ' . $o, 200);
return output($o, 200);
}
}*/
}
if ($_POST['upbigfilename']=='') return output('error: no file name', 400);
if (!is_numeric($_POST['filesize'])) return output('error: no file size', 400);
Expand Down Expand Up @@ -614,11 +615,11 @@ public function bigfileupload($path)
//error_log1($res['body']);
$parent_file_id = json_decode($res['body'], true)['file_id'];
}
if (!function_exists('bcadd')) {
$response = $this->fileCreate($parent_file_id, $filename, $_POST['filesha1'], $fileinfo['size'], ceil($fileinfo['size']/$_POST['chunksize']));
} else {
//if (!function_exists('bcadd')) {
// $response = $this->fileCreate($parent_file_id, $filename, $_POST['filesha1'], $fileinfo['size'], ceil($fileinfo['size']/$_POST['chunksize']));
//} else {
$response = $this->fileCreate1($parent_file_id, $filename, $_POST['filesha1'], $_POST['proof_code'], $fileinfo['size'], ceil($fileinfo['size']/$_POST['chunksize']));
}
//}
$res = json_decode($response['body'], true);
if (isset($res['exist'])) {
// 已经有
Expand Down

0 comments on commit 2b5a3e8

Please sign in to comment.