<%@page import="java.io.*"%>
<%
File file=new File("D:\\gather_info.sql");
byte[] data=new byte[(int)file.length()];
FileInputStream fis=null;
try{
fis=new FileInputStream(file);
int r=fis.read(data);
}catch(Exception e){
e.printStackTrace();
}finally{
if(fis!=null){
try{
fis.close();
}catch(Exception ioe){
ioe.printStackTrace();
}
}
}
response.setHeader("Content-Disposition", "attachment; filename=\""+file.getName()+"\"");
response.addHeader("Content-Length", "" + data.length);
response.setContentType("application/octet-stream;charset=UTF-8");
OutputStream outputStream = new BufferedOutputStream(response.getOutputStream());
outputStream.write(data);
outputStream.flush();
outputStream.close();
response.flushBuffer();
%>