This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to upload files in Java  RSS feed

 
Jacky Ho
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to use JAVA to do the same thing as the following html code
<form enctype="multipart/form-data" method="post" action="http://aagrawal.desktop.amazon.com:3000/cgi-bin/XSLTtest.cgi">
<h4>XML Content Info</h4>
<p>Input XSL: </p>
<input type="file" name="xslfile"/>
<br>
<p>Input XML:</p>
<input type="file" name="xmlfile"/>
<br><br><input type="submit" value="Transform">
</form>
May I know how to do it? What things should I set in the URLConnection object? And what should I do to handle multiple files upload? Thanks
 
Ken Krebs
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want a reply, I would suggest you describe precisely what you want the code to do instead of providing a bunch of HTML that has to be reverse engineered. That's expecting a bit much.
 
Juanjo Bazan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need a servlet in your server to manage the multipart data.
You may use the oreilly package to do so:
http://oreilly upload package at servlets.com
HTH
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!