File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes commons FileUpload. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "commons FileUpload." Watch "commons FileUpload." New topic
Author

commons FileUpload.

sunitha reghu
Ranch Hand

Joined: Dec 12, 2002
Posts: 937
I have only used fileupload. One of the problem i faced is when the
enctype="multipart/form-data" ,all other input fields values except file can not be processed. Is there any workaround for that.
Mike Wang
Ranch Hand

Joined: May 09, 2003
Posts: 76
Originally posted by sunitha raghu:
I have only used fileupload. One of the problem i faced is when the
enctype="multipart/form-data" ,all other input fields values except file can not be processed. Is there any workaround for that.

You may consult how struts handle this.


SCJP1.4<br />SCWCD 1.4 (Beta)<br />SCMAD 1.0 (Beta)<br />SCDJWS (Beta)<br />SCBCD 1.3 <br />SCJD <br />SCEA (Prepairing)<br />"I am mike, not milk"
sunitha reghu
Ranch Hand

Joined: Dec 12, 2002
Posts: 937
unfortunately im not using struts in my app.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
I believe Mike meant that you should download the source code for Struts and take a look at how the Struts team has solved the problem.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
jim ke
Greenhorn

Joined: Jan 08, 2004
Posts: 4
Multipart form reading :
I've been using
import com.oreilly.servlet.*;
import com.oreilly.servlet.multipart.*;
import com.oreilly.servlet.multipart.MultipartParser;
You can download it. ( forgot the url).
You're also supposed to buy the book - it will be in the liscense.
It's a good book to have even if ya don't use the classes.
Peace,
jim
sunitha reghu
Ranch Hand

Joined: Dec 12, 2002
Posts: 937
Jason Hunters package doesnt have that problem. But as i said using commons fileupload what is the solution.
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
Using Jakarta Commons FileUpload you can also process any other input field value in a multipart request. Just use the isFormField() method of the FileItem class.
Try this:

HTH
Juanjo
frisode jonge
Ranch Hand

Joined: Dec 30, 2003
Posts: 34
ok,
even if you are not using struts as mvc model, you can still use the struts taglibs. (and the jars obviously)
sunitha reghu
Ranch Hand

Joined: Dec 12, 2002
Posts: 937
I tried that. ie why i asked the que. It wont work.

Originally posted by Juanjo Bazan:
Using Jakarta Commons FileUpload you can also process any other input field value in a multipart request. Just use the isFormField() method of the FileItem class.
Try this:

HTH
Juanjo
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
Originally posted by sunitha raghu:
I tried that. ie why i asked the que. It wont work.

I wont work?
I have it working on production enviroment.
Check your code or tell as what exception are you getting.
sunitha reghu
Ranch Hand

Joined: Dec 12, 2002
Posts: 937
there is no exception. since the form type is "multipart" other input values will be null. make two text fields in spite of input type file
and check whether u able to get the values of other fields.
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Just an outsider question. It seems that there are lots of open projects, each of them has its own FileUpload, or even other similar modules, like logging, etc.
In fact, why they do so? They cannot just use the same module, or share their modules to each other? I feel it is too difficult to manage so much technologies that ususally share the same functions.
Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Mike Wang
Ranch Hand

Joined: May 09, 2003
Posts: 76
Originally posted by Nicholas Cheung:
Just an outsider question. It seems that there are lots of open projects, each of them has its own FileUpload, or even other similar modules, like logging, etc.
In fact, why they do so? They cannot just use the same module, or share their modules to each other? I feel it is too difficult to manage so much technologies that ususally share the same functions.
Nick

Thy maven , actually Jakarta libary is the offical lib of our comany. When we need a new function, we will consult whether Jakarta has already solved it.
Mike Wang
Ranch Hand

Joined: May 09, 2003
Posts: 76
Originally posted by Lasse Koskela:
I believe Mike meant that you should download the source code for Struts and take a look at how the Struts team has solved the problem.

Yes, you got me
VijayRawat Rawat
Greenhorn

Joined: Aug 19, 2004
Posts: 9
Hi All,
I am using the same facility of file upload.
The problem is that when I am trying to upload file using my own servlet its working fine, but when I am trying to upload using Struts(struts tags), its giving problem. Its not able to come to Action class either.
Can somebody throw light on this

Thanks in advance
Vijay
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
you should see example about Struts Upload.

And please post your code that it's have error for more information to solve this problem.
[ October 31, 2004: Message edited by: somkiat puisungnoen ]

SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
 
Consider Paul's rocket mass heater.
 
subject: commons FileUpload.