upload control

This commit is contained in:
CHIEFSOFT\ameye
2023-06-01 20:58:15 -04:00
parent 0c5660de1f
commit 2f2f409ffe
2 changed files with 11 additions and 1 deletions
+6 -1
View File
@@ -413,6 +413,7 @@ class WrenchApi extends BaseController
log_message('critical', "0001");
header('Access-Control-Allow-Origin: *');
log_message('critical', "0002");
$call_backend = true;
/*
//header("Access-Control-Allow-Origin: http://localhost:9057 ");
header('Access-Control-Expose-Headers: Access-Control-Allow-Origin');
@@ -465,6 +466,10 @@ class WrenchApi extends BaseController
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ( $endpoint == 'uploads'){
$local_out=["test_msg"=>'Yes the upload endpoinmt was hit********'];
$call_backend = false; // will be decided after file is saved
}
if (isset($_FILES) && is_array($_FILES) && count($_FILES)>0) {
$raw_array = array_merge($_POST,$_FILES);
}
@@ -482,7 +487,7 @@ class WrenchApi extends BaseController
//$in = $raw_array;
log_message('critical', "wrenchboard_api-CALL RAW DATA".serialize($raw_array) );
//-- move to another module start
$call_backend = true;
$local_out =[];
$in["loc"] = $_SERVER["REMOTE_ADDR"];
$in = $this->prepareEndPointData($endpoint, $raw_array,$call_backend,$local_out);
+5
View File
@@ -133,6 +133,11 @@ if (array_search($_SERVER['REQUEST_METHOD'], $methods) === false) {
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ( $endpoint == 'uploads'){
$local_out=["test_msg"=>'Yes the upload endpoinmt was hit******** 777'];
$call_backend = false; // will be decided after file is saved
}
$call_backend = false;
if (isset($_FILES) && is_array($_FILES) && count($_FILES)>0) {
$in = array_merge($_POST,$_FILES);
}