/** * @param $file视频路径 * @param $showname 显示下载的视频名称 * @return int|string */ public function download_file($file,$showname){if(is_file($file)){$length = filesize($file);header("Content-Description: File Transfer");header('Content-type: video/mp4');header('Content-Length:' . $length);if (preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) { //for IEheader('Content-Disposition: attachment; filename="' . rawurlencode($showname.'.mp4') . '"');} else {header('Content-Disposition: attachment; filename="' . $showname.'.mp4' . '"');}return readfile($file);} else {return('文件已被删除!');}}