This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Upload file using servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Upload file using servlet" Watch "Upload file using servlet" New topic

Upload file using servlet

felix thomas
Ranch Hand

Joined: Jun 10, 2001
Posts: 89
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

Joined: Aug 31, 2003
Posts: 16
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

Joined: Sep 09, 2001
Posts: 427
Jakarta Struts has file upload capabilities.
If you aren't using Struts, look at these libraries:
subject: Upload file using servlet
Similar Threads
How can I upload a File using Struts
using file chooser
How to upload a file using a servlet?
File Upload
How can i upload a file using Struts