File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Image insertion problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Image insertion problem" Watch "Image insertion problem" New topic
Author

Image insertion problem

Nazeer Ahammad
Ranch Hand

Joined: Feb 26, 2012
Posts: 43


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

Joined: Jan 10, 2002
Posts: 61187
    
  66

Well, is the request a multi-part form? If not, it must be. See the JspFaq for more details on file uploading.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nazeer Ahammad
Ranch Hand

Joined: Feb 26, 2012
Posts: 43
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

Joined: Jan 10, 2002
Posts: 61187
    
  66

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

Joined: Jan 04, 2011
Posts: 112

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..


SCJP5
Swetha Bhagavathula
Ranch Hand

Joined: Jan 04, 2011
Posts: 112

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..
 
wood burning stoves
 
subject: Image insertion problem