• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to upload a file using a servlet?

 
chad stevens
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you upload a file using a servlet?
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic