jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes file uploading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "file uploading " Watch "file uploading " New topic
Author

file uploading

reddy palwai
Greenhorn

Joined: Nov 06, 2002
Posts: 11
Hi ,
I have a question about file uploading in servlets.
I have an html form with an input file type as FILE and enctype as multipart/form-data.
<FORM ENCTYPE="multipart/form-data" ACTION="blobinsert" METHOD=POST>
<INPUT TYPE=FILE NAME="uploadfile">
In my servlet I need to get the parameters from the html form.
For text and other input types we can get the parameters using getParameter(). But how can I get the data from when file is uploaded?
Please Help!! this is kind of Urgent.
Thanks in advance.
reddy
sonny kher
Ranch Hand

Joined: Nov 06, 2001
Posts: 83
you are better of using a custom API for this. I did a similar application recently and to get binary data I used
this API
Check it out its pretty simple and cuts down on a lot of work you'd have to do otherwise.
-sonny


_ __________________ _ <br />RHCE<br />SCJP<br />??:-(
reddy palwai
Greenhorn

Joined: Nov 06, 2002
Posts: 11
Thanks Sony.
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
this API
-sonny

this link is not working...!!!
malhar
daman sidhu
Ranch Hand

Joined: Aug 19, 2000
Posts: 184
try using oriellys classes for the same, very good for multipart file transfers.. i guess they can be downloaded from their website.. tho i got them from the CD along with the servlets book..
Cheers!!
Daman
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by malhar barai:

this link is not working...!!!
malhar

Check this
jsp smart upload


Spritle Software Blogs
reddy palwai
Greenhorn

Joined: Nov 06, 2002
Posts: 11
I have used orielly's classes for multipart file transfers. I downloaded the package from their web site. It worked!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: file uploading
 
Similar Threads
file upload from servlet
Java Mail Question...
Can't get Text value from ENCTYPE=multipart/form-data
RequestParameters
About form submission