PORTRAIT
This commit is contained in:
@@ -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 /
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user