文件下载

来源:互联网 发布:微信商城java源码下载 编辑:程序博客网 时间:2024/06/05 12:07
public function actionDownloadxls(){    $file_path=dirname(__FILE__).'/'.iconv("utf-8","gb2312",'模板.xls');    // 输入文件标签    Header("Content-type: application/octet-stream");    Header("Accept-Ranges: bytes");    Header("Accept-Length: ".filesize($file_path));    Header("Content-Disposition: attachment; filename=模板.xls");    readfile($file_path);}
0 0
原创粉丝点击