This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Image insertion problem

 
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]

 
Marshal
Posts: 67292
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
Marshal
Posts: 67292
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
Ranch Hand
Posts: 112
Oracle Java
  • 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
Oracle Java
  • 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..
 
this is supposed to be a surprise, but it smells like a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!