Meaningless Drivel is fun!
The moose likes Servlets and the fly likes Uploading files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Uploading files" Watch "Uploading files" New topic

Uploading files

Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
hey folks,

i have to upload files from the clients machine to the server.
in some cases there is one file that must be uploaded from a web page, in others there should be a possibility to upload a number of files together.

i think apache.commons.fileupload project has a nice feature
for multi-file uploads. but! the files must be uploaded from a form
with ENCTYPE="multipart/form-data"... and i have tens of other text params that should be delivered by a regular request (with a content type "text/html")... does anyone know a tricky way to send this mixed stuff together ? thanks!

Asher Tarnopolski
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Look at the FileItem.isFormField() method.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Moreover, look at
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
yup, thanks!
I agree. Here's the link:
subject: Uploading files
It's not a secret anymore!