• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Image insertion problem

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]

 
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
reply
    Bookmark Topic Watch Topic
  • New Topic