From 7c55bc72acbda4522767531f27fbbf51c2305bb6 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 26 Mar 2019 09:31:24 +0100 Subject: Delete unused legacy API too --- apis/webservice/upload.php | 62 ---------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 apis/webservice/upload.php (limited to 'apis/webservice/upload.php') diff --git a/apis/webservice/upload.php b/apis/webservice/upload.php deleted file mode 100644 index 50ada40e..00000000 --- a/apis/webservice/upload.php +++ /dev/null @@ -1,62 +0,0 @@ -"Not logged in", - "status" => "error", - "msg" => "")); - die(); -}elseif (!isset($_FILES['fileToUpload'])){ - echo json_encode(array( - "errormsg"=>"No file received", - "status" => "error", - "msg" => "")); - die(); -} - -$upload = Database::queryFirst("Select * from upload where token = :token", - array( "token" => $_POST['uploadid'])); -if($upload['userid']!= $_SESSION['userid']){ - echo json_encode(array( - "errormsg"=>"Not same owner", - "status" => "error", - "msg" => "")); - die(); -} - -$name = $_FILES["fileToUpload"]["name"]; -$upload['nremaining'] = $upload['nremaining'] - 1; -if ($upload['nremaining'] < 0){ - echo json_encode(array( - "errormsg"=>"Already received all the parts", - "status" => "error", - "msg" => "")); - die(); -} -$target_file = $target_dir.$_POST['uploadid']."/".$name; -if(move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)){ - $ret = Database::exec("UPDATE upload SET nremaining= :nremaining". - " WHERE id=:id", array( - "id"=>$upload['id'], - "nremaining"=>$upload['nremaining'] - )); - if ($upload['nremaining'] == 0) { - echo json_encode(array( - "errormsg"=>"", - "status" => "ok", - "msg" => "Upload successful, sending to taskmanager")); - //passa pro taskmanager; - die(); - }else{ - echo json_encode(array( - "errormsg"=>"", - "status" => "ok", - "msg" => "Upload successful, waiting next part")); - die(); - } -} else { - echo json_encode(array( - "errormsg"=>"", - "status" => "error", - "msg" => "Error on upload, please resend")); -} - -- cgit v1.2.3-55-g7522