<?
class c_services_get_video
{
 function show()
 {  $arrContextOptions=array(
     "ssl"=>array(
         "verify_peer"=>false,
         "verify_peer_name"=>false,
     ),
 );  

 	if ($_GET['url'])                    
    { $url=(($GLOBALS['LS_use_localhost_in_pdf']))? str_replace(_PATH_TO_SITE,_MAIN_PROTOCOL.'127.0.0.1',$_GET['url']):$_GET['url'];
      $url=rawurldecode($url) ;
      $cont=file_get_contents($url, false, stream_context_create($arrContextOptions)) ;
    }
    if ($_GET['fname']) $cont=file_get_contents($_SERVER['DOCUMENT_ROOT'].'/temp/'.$_GET['fname']) ;
    if ($cont)
    { header('Content-Description: File Transfer');
      header('Content-Transfer-Encoding: binary');
      header('Cache-Control: public, must-revalidate, max-age=0');
      header('Pragma: public');
      header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
      header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
      header('Content-Length: '.strlen($cont));
      header('Content-Type: application/force-download');
      header('Content-Type: application/octet-stream', false);
      header('Content-Type: application/download', false);
      header('Content-disposition: attachment; filename="'.basename($_GET['url']).'"');
      echo $cont ;
    } else echo 'Файл не найден' ;
 }
}

?>