Upload engine

This commit is contained in:
CHIEFSOFT\ameye
2023-06-03 16:42:11 -04:00
parent 871c42bb4a
commit 2552160a71
7 changed files with 22 additions and 16 deletions
+4 -3
View File
@@ -1,8 +1,8 @@
<?php
function reciveUpload($in,$out){
$savePath ="/opt/wrenchboard/TEST/";
function reciveUpload($in, $out){
$savePath = WRENCHBOARD_UPLOAD_PATH; //"/opt/wrenchboard/TEST/";
$action = $in["action"];
@@ -46,6 +46,7 @@ function reciveUpload($in,$out){
case WRENCHBOARD_CONTRACT_MESSAGE:
// MAKE SURE FOLDER AS PER PROECESS IS AVILABLE
$out["call_backend"] = false; // flag ready to save data entry
$thisContactFolder = $savePath.'CONTRACTS/'.$in["contract"];
if (!file_exists($thisContactFolder)) {
mkdir($thisContactFolder, 0777, true);
@@ -66,7 +67,7 @@ function reciveUpload($in,$out){
}
return 0;
return $out;
}
+4 -4
View File
@@ -137,13 +137,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ( $endpoint == 'uploads'){
$local_out=["test_msg"=>'Yes the upload endpoint was hit******** 777'];
$call_backend = false; // will be decided after file is saved
//$out=[];
$in = flatten(json_decode(file_get_contents('php://input'), true));
//$in = json_decode($raw_json, true);
$in["call_backend"] = $call_backend;
$ll = reciveUpload($in, $local_out);
$call_backend = $local_out["call_backend"];
$in["message"] = $local_out["message"];
$out = reciveUpload($in, $local_out);
$call_backend = $out["call_backend"];
$in["message"] = $out["message"];
}
else{