php实现文件的下载

来源:互联网 发布:python自动化测试脚本 编辑:程序博客网 时间:2024/05/16 11:21
public function download($path){        $file=htmlspecialchars_decode(file_get_contents($path));    $outfile=basename($path);    header('Content-type: application/octet-stream; charset=utf8');    Header("Accept-Ranges: bytes");    header('Content-Disposition: attachment; filename='.$outfile);    echo $file;}
原创粉丝点击