fix bug: reupload

pull/17/head
qkqpttgf 2020-02-25 13:07:54 +08:00 committed by GitHub
parent 466fc1d5f2
commit 78329d5d1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -433,8 +433,8 @@ function bigfileupload($path)
//echo json_encode($getoldupinfo, JSON_PRETTY_PRINT); //echo json_encode($getoldupinfo, JSON_PRETTY_PRINT);
if (isset($getoldupinfo['file'])&&$getoldupinfo['size']<5120) { if (isset($getoldupinfo['file'])&&$getoldupinfo['size']<5120) {
$getoldupinfo_j = curl_request($getoldupinfo['@microsoft.graph.downloadUrl']); $getoldupinfo_j = curl_request($getoldupinfo['@microsoft.graph.downloadUrl']);
$getoldupinfo = json_decode($getoldupinfo_j , true); $getoldupinfo = json_decode($getoldupinfo_j['body'], true);
if ( json_decode( curl_request($getoldupinfo['uploadUrl']), true)['@odata.context']!='' ) return output($getoldupinfo_j); if ( json_decode( curl_request($getoldupinfo['uploadUrl'])['body'], true)['@odata.context']!='' ) return output($getoldupinfo_j['body'], $getoldupinfo_j['stat']);
} }
if (!$_SERVER['admin']) $filename = spurlencode( $fileinfo['name'] ) . '.scfupload'; if (!$_SERVER['admin']) $filename = spurlencode( $fileinfo['name'] ) . '.scfupload';
$response=MSAPI('createUploadSession',path_format($path1 . '/' . $filename),'{"item": { "@microsoft.graph.conflictBehavior": "fail" }}',$_SERVER['access_token']); $response=MSAPI('createUploadSession',path_format($path1 . '/' . $filename),'{"item": { "@microsoft.graph.conflictBehavior": "fail" }}',$_SERVER['access_token']);