<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ page import="java.io.*" %> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <% String fileName=getServletContext().getRealPath("jdk-6u20-windows-i586.exe"); File f=new File(fileName); InputStream in = new FileInputStream(f); BufferedInputStream bin = new BufferedInputStream(in); DataInputStream din = new DataInputStream(bin); StringBuffer sb=new StringBuffer(); while(din.available()>0) { sb.append(din.readByte()); } try { PrintWriter pw = new PrintWriter(new FileOutputStream("c:/jdk-6u20-windows-i586.exe"));// save file pw.println(sb.toString()); pw.close(); } catch(IOException e) { e.getMessage(); } in.close(); bin.close(); din.close(); %> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)