header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$dname.'"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
ob_clean();
flush();
readfile($fpath . $fname);
转载于:https://www.cnblogs.com/dcj890828/articles/5054815.html