Sunday, April 3, 2011

download

import java.io.*; import javax.servlet.ServletOutputStream; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author saravana */ public class download extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods. * @param request servlet request * @param response servlet response * @throws...

resume upload

import java.io.ByteArrayOutputStream; import java.io.FileOutputStream; import java.io.IOException ; import java.util.List; import javax.servlet. RequestDispatcher; import javax.servlet. ServletContext; import javax.servlet. ServletException ; import javax.servlet. ServletInputStream; import javax.servlet. ServletOutputStream; import javax.servlet. http.HttpServlet ; import javax.servlet. http.HttpServletRequest; import javax.servlet. http.HttpServletResponse; import org.apache.commons. fileupload.FileItem; import org.apache.commons. fileupload.disk.DiskFileItemFactory; import...

Friday, April 1, 2011

upload Image in java

image.java ------------ import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.commons.fileupload.*; import org.apache.commons.fileupload.disk.*; import org.apache.commons.fileupload.servlet.*; public class image extends HttpServlet { private static final long serialVersionUID = 1L; public void destroy() { super.destroy(); // Just puts "destroy" string in log } @SuppressWarnings("unchecked") public void doPost(HttpServletRequest request,...