一个jsp下载文件的问题

03-08-01 litanjun

代码如下

String fn=request.getParameter("txt");

String realpath1=(String)session.getAttribute("realpath1");

response.setHeader("Content-Disposition: ","attachment;filename="+fn);

response.setContentType("APPLICATION/OCTET-STREAM");

response.setContentLength(1000);

FileInputStream fileInputStream =new FileInputStream(realpath1);

ServletOutputStream output=response.getOutputStream();

int i;

while ((i=fileInputStream.read())!=-1) {

output.write(i);

}

fileInputStream.close();

output.close();

response.flushBuffer();

点击txt文件会出现下载框,但是下载以后再点击其他的链接就没有反应了.