作者:玩玩r28g | 来源:互联网 | 2024-09-24 17:39
php教程|PHP源码php实现中文文件下载php教程-PHP源码php代码爱之谷2015源码,ubuntu16桌面,tomcat9解压缩半,python爬虫带页面,php批量删除
php教程|PHP源码
php实现中文文件下载
php教程-PHP源码
php代码
爱之谷2015 源码,ubuntu16 桌面,tomcat9解压缩半,python爬虫带页面,php批量删除视频教程交流,nuxt seo问题lzw
/* * $filepath 文件路径 * $newfilename 下载时的命名 * download('/abc.xls','abc教学'); * 下载下来的文件将是abc教学.xls */function download($filepath,$newfilename){ $id = intval($_GET['id']); $db = model('tool'); $tool = $db->where('id='.$id)->find(); if(!$tool) $this->error('未找到您要查看的工具'); $ua = $_SERVER["HTTP_USER_AGENT"]; $pathinfo = pathinfo($filepath); $newfilename = $newfilename.'.'.$pathinfo['extension']; $file = fopen( $filepath ,"r"); header('Content-Type: application/octet-stream'); header("Accept-Ranges: bytes"); header("Accept-Length: ".filesize($filepath)); if (preg_match("/MSIE/", $ua)) { header('Content-Disposition: attachment; filename="' . rawurlencode($newfilename) . '"'); } else if (preg_match("/Firefox/", $ua)) { header('Content-Disposition: attachment; filename*="utf8\'\'' . $newfilename . '"'); } else { header('Content-Disposition: attachment; filename="' . rawurlencode($newfilename) . '"'); } echo fread($file, filesize($filepath)); //$db->where('id='.$id)->data($update)->update(); fclose($file); }
asp.net 数据库源码,ubuntu识别串口,如何tomcat中的编码,认识爬虫教案,php基础知识大全,大丰区seo优化信息化服务lzw