File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Upload a file?" Watch "Upload a file?" New topic

Upload a file?

Hari Haran

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
I agree. Here's the link:
subject: Upload a file?
It's not a secret anymore!