可能有两个原因:
文件路径没有拼接对:$file_name=iconv("utf-8","gb2312",$file_name);
建议:在你的downfile函数中添加一行 echo $file_name,验证是否正确
Content_type不对:header("Content_type: application/octet-stream");
建议:重新设置试试