diff --git a/www-api/app/Controllers/WrenchMedia.php b/www-api/app/Controllers/WrenchMedia.php index 306bc8ae..7e56f352 100644 --- a/www-api/app/Controllers/WrenchMedia.php +++ b/www-api/app/Controllers/WrenchMedia.php @@ -48,6 +48,7 @@ class WrenchMedia extends BaseController $call_backend = false; $uriSegments = explode("/", parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); $segLen = count($uriSegments); + $micro_service_net1 = $this->getSiteConfigurations("system.micro_service_net1"); //"10.10.10.120"; if ( $segLen < 4 ){ return; @@ -212,16 +213,9 @@ class WrenchMedia extends BaseController default: } - switch( $file_extension ) { - case "mp4": - header('Content-Description: File Transfer'); - //header('Content-Type: application/octet-stream'); - header('Content-Disposition: attachment; filename="'.basename($selectedFile).'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - break; - default: + if( $file_extension ) { + $local_url = "http://".$micro_service_net1.":3036/myfile/".$out["flie_uid"]; + return ["aaaa"=>$local_url]; } header('Content-type: ' . $ctype); readfile($selectedFile);