• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

commons FileUpload.

 
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
unfortunately im not using struts in my app.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jason Hunters package doesnt have that problem. But as i said using commons fileupload what is the solution.
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic