This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes How to upload a file using a servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to upload a file using a servlet?" Watch "How to upload a file using a servlet?" New topic
Author

How to upload a file using a servlet?

chad stevens
Ranch Hand

Joined: Aug 20, 2002
Posts: 88
How do you upload a file using a servlet?
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
hi chad,
can you use multipart/form-data? look at com.oreilly.servlet api that has MultipartRequest handler etc to handle these multipart/form-data requests fromthe browser...
you can use html's file input type to browse the file you want to upload via the servlet and achieve what you want..
regards
maulin
Kayla Richard
Greenhorn

Joined: Jan 20, 2003
Posts: 29
Hi Maulin.
Thanks. I looked at that already and it seems quite complex and I think with certain file types it may not work. How about SmartUpload? Are you familiar with this?
chad stevens
Ranch Hand

Joined: Aug 20, 2002
Posts: 88
Kayla.
I think JSPSmartUpload can only be used with JSP I am not too sure about this, it's why I am posting! You are right, MultiParse does look complex.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to upload a file using a servlet?
 
Similar Threads
How can I upload a File using Struts
using file chooser
How can I upload a file(*.doc,*.zip...) within a servlet?
UPLOAD A FILE in JSP
Access POST request parameter in a multipart request