方法可以不报错走完,但是不弹下载提示保存框,代码如下,跪求帮助public void downLoad() throws Exception {
String filePath = request.getParameter("filePath");
// File f = new File(filePath);
File f = new File(new String(filePath.getBytes("ISO8859-1"),"utf-8"));
BufferedInputStream br = new BufferedInputStream(new FileInputStream(f));
byte[] buf = new byte[1024];
int len = 0;
response.reset();
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment; filename="
+ toUTF8(f.getName()));
OutputStream out = response.getOutputStream();
while ((len = br.read(buf)) > 0)
out.write(buf, 0, len);
out.flush();
br.close();
out.close();
logger.info("下载结束");
String filePath = request.getParameter("filePath");
// File f = new File(filePath);
File f = new File(new String(filePath.getBytes("ISO8859-1"),"utf-8"));
BufferedInputStream br = new BufferedInputStream(new FileInputStream(f));
byte[] buf = new byte[1024];
int len = 0;
response.reset();
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment; filename="
+ toUTF8(f.getName()));
OutputStream out = response.getOutputStream();
while ((len = br.read(buf)) > 0)
out.write(buf, 0, len);
out.flush();
br.close();
out.close();
logger.info("下载结束");
这玩意应该是输出到日志中去了吧,怎么会弹框呢