my dog learned polymorphism*
The moose likes Servlets and the fly likes Upload a file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Upload a file?" Watch "Upload a file?" New topic
Author

Upload a file?

Hari Haran
Greenhorn

Joined: Sep 21, 2000
Posts: 19
I want to upload a file in the server.
I have a html page where there is a button .
On clicking which a Filedialog box appears.
When the user selects a file the file should be uploaded into the server.
Can someone help me out with an example in servlets.
Paul Wetzel
Ranch Hand

Joined: Nov 02, 1999
Posts: 107
This is a common action to be preformed and the best resource is to download from oreilly (tho book people with animals etc. on the cover) a package called com.oreilly.servlets and in that package is a class called multipart request. When you submit your form creat a MultipartRequest object from the HTTPRequest object and some other parameters. The third book on the header above is the book that contains the code and example. Let me know if you need more info.
good luck
 
jQuery in Action, 2nd edition
 
subject: Upload a file?