Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image insertion problem

 
Nazeer Ahammad
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


When i am executing this program getting problem like

org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded

[Added code tags - see UseCodeTags]

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64711
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, is the request a multi-part form? If not, it must be. See the JspFaq for more details on file uploading.
 
Nazeer Ahammad
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i used enctype="multipart/form-data" in form tag i am not getting input type="text" values . Can any one help me.How can i get input type="text" values when i am using enctype="multipart/form-data" in form tag.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64711
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the javadoc -- the getParameter() class of methods will not work with multi-part forms.

What upload library are you using? Its documentation will tell you how to get submitted values.
 
Swetha Bhagavathula
Ranch Hand
Posts: 112
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ..

why don't you use : the following packages .. (need to download seperately -not present in jdk software they belongs to javazoom api , used for file uploading and downloading)
but before that you need to use struts.jar,cos.jar,uploadbean.jar(please set the JAR files in CLASSPATH,please don't forget)
and try to use :

and follwoing package import statements:



Please try with above.. If I am wrong , please correct me..
 
Swetha Bhagavathula
Ranch Hand
Posts: 112
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hope this is also helpful , you need to use "UploadBean" class and try like this by modifying your code:


the above is one the ways where we can upload the pictures and documents..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic