Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

How to upload files in Java

 
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
 
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.
 
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
 
Don't touch me. And dont' touch this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic