web开发中apk文件下载失败!

apk文件下载在电脑端下载是正常的,为什么在手机端用二维码扫描下载还是在浏览器中打开下载,都会在服务器抛出异常:java.net.SocketException: Software caused connection abort: socket write error 请各位大神列出解决方案,多谢多谢

百度有不少
百度 :java.net.SocketException: Software caused connection abort: socket write error

基本昨天一晚上在查,还是不行啊,不知道是为什么,手机访问下载就跟电脑下载时点击了取消的一模一样。

String fileName = "androidApp.apk";//下载文件的名称加扩展名
String filePath = getServletContext().getRealPath(
"/App/" + fileName);////获取目标文件的绝对路径

//设置文件MIME类型

response.setContentType(getServletContext().getMimeType(fileName));
//设置Content-Disposition

response.setHeader("Content-Disposition", "attachment;filename="
+ fileName);
try {
InputStream in = new FileInputStream(filePath);//z读取文件
OutputStream os = response.getOutputStream();
try {
int b;
while ((b = in.read()) != -1) {
os.write(b);
}
} finally {
in.close();
os.close();
}
} finally {
}
out.clear();
out = pageContext.pushBody();

有可能是没有flush,flush下试试看