image load
This commit is contained in:
@@ -185,8 +185,34 @@ class WrenchMedia extends BaseController
|
||||
$endpoint = "SECUREFILE-".$selectedFile_CACHE_KEY;
|
||||
$this->saveCache($endpoint,$out,10000);
|
||||
}
|
||||
log_message('critical', "AFTER CACHE*********");
|
||||
if ($supportedSections[$fileSection] == WRENCH_FILE_CONTRACTS || $supportedSections[$fileSection] == WRENCH_FILE_MYFILE){
|
||||
|
||||
|
||||
log_message('critical', "FILE ************************** --->0003");
|
||||
$filename = basename($out["saved_file_name"]);
|
||||
$file_extension = strtolower(substr(strrchr($filename,"."),1));
|
||||
switch( $file_extension ) {
|
||||
case "gif": $ctype="image/gif"; break;
|
||||
case "png": $ctype="image/png"; break;
|
||||
case "jpeg":
|
||||
case "jpg": $ctype="image/jpeg"; break;
|
||||
case "svg": $ctype="image/svg+xml"; break;
|
||||
case "mp4": $ctype="application/octet-stream"; break;
|
||||
// case "mp4": $ctype="video/mp4"; break;
|
||||
default:
|
||||
}
|
||||
|
||||
$LOAD_LOCAL = false;
|
||||
$localF = array("gif", "png", "jpeg", "jpg", "svg");
|
||||
if (in_array( $file_extension, $localF)) {
|
||||
$LOAD_LOCAL = true;
|
||||
}
|
||||
|
||||
|
||||
log_message('critical', "AFTER CACHE*********");
|
||||
if (
|
||||
$supportedSections[$fileSection] == WRENCH_FILE_CONTRACTS
|
||||
|| $supportedSections[$fileSection] == WRENCH_FILE_MYFILE
|
||||
|| $LOAD_LOCAL){
|
||||
log_message('critical', "FILE ************************** --->0001");
|
||||
if (file_exists($selectedFile)) {
|
||||
log_message('critical', "FILE ************************** --->0002");
|
||||
@@ -202,21 +228,10 @@ class WrenchMedia extends BaseController
|
||||
}
|
||||
exit();
|
||||
}
|
||||
log_message('critical', "FILE ************************** --->0003");
|
||||
$filename = basename($out["saved_file_name"]);
|
||||
$file_extension = strtolower(substr(strrchr($filename,"."),1));
|
||||
switch( $file_extension ) {
|
||||
case "gif": $ctype="image/gif"; break;
|
||||
case "png": $ctype="image/png"; break;
|
||||
case "jpeg":
|
||||
case "jpg": $ctype="image/jpeg"; break;
|
||||
case "svg": $ctype="image/svg+xml"; break;
|
||||
case "mp4": $ctype="application/octet-stream"; break;
|
||||
// case "mp4": $ctype="video/mp4"; break;
|
||||
default:
|
||||
}
|
||||
|
||||
if( $file_extension ) {
|
||||
|
||||
|
||||
if( $file_extension) {
|
||||
$local_url = "http://".$micro_service_net1.":3036/myfile/".$out["flie_uid"];
|
||||
log_message('critical', "FILE URL ===== ---> ".$local_url );
|
||||
return ["aaaa"=>$local_url];
|
||||
|
||||
Reference in New Issue
Block a user