1.前台
2后台
public function downfile()
{
ob_start();
$id = I('get.id');
$bpapplys = D('Bpapply')->selectOne($id);
//上线后需要修改路径为绝对路径,否则下载不全
$fileurl="http://www.jjfuhuaqi.com/Upload/bpapply/".$bpapplys['bp_bpimg'];
set_time_limit(0);
ini_set('memory_limit', '512M');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($fileurl));
header('Content-Transfer-Encoding: binary');
ob_end_clean();
$size = readfile($fileurl);
header( "Accept-Length: " .$size);
}