Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

commons FileUpload.

 
sunitha reghu
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sunitha reghu
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
unfortunately im not using struts in my app.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
jim ke
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason Hunters package doesnt have that problem. But as i said using commons fileupload what is the solution.
 
Juanjo Bazan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mike Wang
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic