This commit is contained in:
CHIEFSOFT\ameye
2023-10-07 17:19:54 -04:00
parent 36e90f8cc3
commit b95bf5360d
2 changed files with 38 additions and 0 deletions
+8
View File
@@ -61,6 +61,14 @@ class WrenchMedia extends BaseController
* VERIFY ALL PARAMETERS ARE GOOD
*/
if( $this->sessionCheckString($sessionId)== PHP_API_OK ){
}
else{
return 0;
}
//We can check cache for the file or
// OR
// WE need to ask backend for this file now /
+30
View File
@@ -31,7 +31,37 @@ class UploadManager extends Model
$out= $in;
switch ($action){
case WRENCHBOARD_PICTURE_PROFILE:
if ( trim($in["uid"]) == ''){
$out["error_msg"] = "invalid_upload_call";
$out["call_backend"] = false; // something went bad
return -1;
}
// MAKE SURE FOLDER AS PER PROCESS IS AVAILABLE
$thisProfileFolder = $this->savePath.'PROFILE/'.$in["uid"];
if (!file_exists($thisProfileFolder)) {
mkdir($thisProfileFolder, 0777, true);
}
if (!file_exists($thisProfileFolder."/PORTRAIT")) {
mkdir($thisProfileFolder."/PORTRAIT", 0777, true);
}
$myFilesFolder = $thisProfileFolder."/PORTRAIT";
if (file_exists($myFilesFolder)) {
$tt_d = date('hisjmy');
$out["message"] = $tt_d."-".$in['file_name'];
$myFilesFolderFileName = $myFilesFolder.'/'.$out["message"];
$myfile = fopen($myFilesFolderFileName, "w") or die("Unable to open file!");
$file_data = base64_decode($in["file_data"]);
fwrite($myfile, $file_data);
fclose($myfile);
$out["call_backend"] = true; // flag ready to save data entry
}
break;
case WRENCHBOARD_PICTURE_FAMMEMBER:
case WRENCHBOARD_RESOURCE_MYFILES: