这样吗? 将值放在response里面返回去 //获取目标文件的绝对路径 String fullFileName = getServletContext().getRealPath("/download/" + filename); //System.out.println(fullFileName); //读取文件 InputStream in = new FileInputStream(fullFileName); OutputStream out = response.getOutputStream(); //写文件 int b; while((b=in.read())!= -1) { out.write(b); } in.close(); out.close();
62,628
社区成员
307,259
社区内容
加载中
试试用AI创作助手写篇文章吧