fix family files

This commit is contained in:
CHIEFSOFT\ameye
2023-11-05 15:05:51 -05:00
parent af9d5b5072
commit a1953d188d
2 changed files with 29 additions and 18 deletions
+27 -18
View File
@@ -87,12 +87,12 @@ class WrenchMedia extends BaseController
*/
log_message('critical', "Media gate Path GATE 005 - Ready to File File ****");
$file = FCPATH.'/assets/images/books.png';
// header('Content-Type: image/jpeg');
header('Content-Type: image/png');
readfile($file);
exit();
// $file = FCPATH.'/assets/images/books.png';
// // header('Content-Type: image/jpeg');
// header('Content-Type: image/png');
// readfile($file);
//
// exit();
$data = [
@@ -110,6 +110,7 @@ class WrenchMedia extends BaseController
}
$selectedFile="";
switch($supportedSections[$fileSection]){
case WRENCH_FILE_PROFILE:
@@ -131,19 +132,27 @@ class WrenchMedia extends BaseController
log_message('critical', "wrenchboard_api-CALL MEDIA selectedFile DATA".$selectedFile );
$file = $selectedFile; // 'books.png';
$file = FCPATH.'/assets/images/books.png';
// header('Content-Type: image/jpeg');
header('Content-Type: image/png');
readfile($file);
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($file).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
}
exit();
//
// $file = $selectedFile; // 'books.png';
//
// if (file_exists($file)) {
// header('Content-Description: File Transfer');
// header('Content-Type: application/octet-stream');
// header('Content-Disposition: attachment; filename="'.basename($file).'"');
// header('Expires: 0');
// header('Cache-Control: must-revalidate');
// header('Pragma: public');
// header('Content-Length: ' . filesize($file));
// readfile($file);
// exit;
// }
}
+2
View File
@@ -114,6 +114,8 @@ class UploadManager extends Model
$out["call_backend"] = false; // flag ready to save data entry
$data['file_uid'] = $in["uid"];
$data['profile'] = $in["profile"];
$data['family_uid'] =$in["family_uid"];
$data['sessionid'] =$in["sessionid"];
$data['member_id'] = $in["member_id"];
$data['file_section'] = WRENCH_FILE_FAMILY;
$out['upload_result'] = $this->specififBackendCall(WRENCHBOARD_SAVE_MEDIA, $data);