Skip to main content

Posts

Showing posts from April, 2013

Uploading file using Servlet/JSP with the help of apache commons-fileupload library

Here is the example to upload the file using commons fileupload library. package  imagesvideos.webcontroller; import  java.io. File ; import  java.io. IOException ; import  java.io. PrintWriter ; import  java.util. List ; import  javax.servlet.ServletException; 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.FileUploadException; import  org.apache.commons.fileupload.disk.DiskFileItemFactory; import  org.apache.commons.fileupload.servlet.ServletFileUpload; public   class  UploadImageVideo  extends  HttpServlet  {      private   static   final   long  serialVersionUID  =   1L ;      protected   void   doPost ( HttpServletRequest...