//获取扩展名
$ex = get_extension($tfilepath);
     
      $filename = $info['title'] . $ex;
if($ex == '.exe'){
   $filename= $info['title'];
   header("Content-Transfer-Encoding: binary");
   header('Content-type: application/octet-stream');
   header('Content-Disposition: attachment; filename='.urlencode($filename));
}else{
   header('Content-Type: application/vnd.ms-excel');
   header("Content-Disposition:attachment; filename=".urlencode($filename));
   header('Cache-Control: max-age=0');
}

      echo readfile($tfilepath);


今日吐槽

让烦恼与风去远行;让痛苦陪云去流浪。哼一曲好歌,也许心情,就会轻松许多

Contact ME

TAG Link