• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Upload file using servlet

 
felix thomas
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Can anyone show a sample code how to upload a file to a server using servlets. I don't what any third party tool. I am making a servlet which will get from the user the path of the file ,then i have to upload it.
I want the complete code or example how it can be done.
 
rick zorich
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need any thrid party packages. If you have JavaMail in your classpath, then you could use it's methods to parse the multipart request.
Here is demonstration JSP. Please share your final code with us.
 
Sean Sullivan
Ranch Hand
Posts: 427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jakarta Struts has file upload capabilities.
If you aren't using Struts, look at these libraries:
http://jakarta.apache.org/commons/fileupload/
http://www.servlets.com/cos/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic