File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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
SCJP,SCWCD
Ben Souther
Sheriff

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 http://jakarta.apache.org/commons/fileupload/using.html.
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
yup, thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uploading files