php-文件下载
来源:互联网 发布:vua软件 编辑:程序博客网 时间:2024/05/17 09:22
/** * 文件下载 * @param $filepath 文件路径 * @param $filename 文件名称 */function file_down($filepath, $filename = '') { if(!$filename) $filename = basename($filepath); if(is_ie()) $filename = rawurlencode($filename); $filetype = fileext($filename); $filesize = sprintf("%u", filesize($filepath)); if(ob_get_length() !== false) @ob_end_clean(); header('Pragma: public'); header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: pre-check=0, post-check=0, max-age=0'); header('Content-Transfer-Encoding: binary'); header('Content-Encoding: none'); header('Content-type: '.$filetype); header('Content-Disposition: attachment; filename="'.$filename.'"'); header('Content-length: '.$filesize); readfile($filepath); exit;}
0 0
- PHP实现文件下载
- PHP实现文件下载
- PHP实现文件下载
- php 文件下载类
- php自动下载文件
- php下载文件代码
- PHP实现文件下载
- 关于PHP文件下载
- PHP强制性文件下载
- php 下载文件代码
- PHP下载文件
- php下载文件
- php强制下载文件
- php下载文件
- php下载文件
- php下载文件方法
- php下载文件
- PHP下载文件代码
- IO流之File类
- 搞定支付宝和微信支付的各种填坑
- C#中的数据类型
- iOS开发中的日期处理 -
- 本地代码git到github上
- php-文件下载
- Linux下NFS服务器部署
- C语言(如何优雅地使用字符串)
- [C/C++]_[初级]_[使用remove,remove_if,remove_copy_if过滤元素或字符]
- python 线程与进程
- g++字节对齐
- python抓取南阳理工学院ACM网站排名信息
- Qt 获取硬盘可用字节
- 计算机专业英语-02:Text 1 The Computer System