• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file upload in servlet?

 
kriti sharma
Ranch Hand
Posts: 160
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a form which lets the user choose three files from its system by the <input type=file> form element. i have put the <form enctype="multipart/form-data" action="some_url" method="PUT">
i do not know how to use PUT. what url must be specified here. can some one please give an example and explain.

is it that this file upload can only be done by PUT request? because the form has two text fields as well. how can i retrieve files as well as text informations?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use POST and a multi-part reader. Lots of people start with Jason Hunter's code: http://www.servlets.com/cos/index.html. I found his Java to look a lot like a literal translation from C or some procedural langauge, but it works. Remember that anti-hamburger commercial ... don't look under the hood?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic