• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error while uploading picture on database.

 
sarojni agrwal
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to upload picture on database, but I got error ...

HTTP Status 500 - org.apache.tomcat.util.http.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


type Exception report

message org.apache.tomcat.util.http.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

description The server encountered an internal error that prevented it from fulfilling this request.

exception
javax.servlet.ServletException: org.apache.tomcat.util.http.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
org.apache.catalina.connector.Request.parseParts(Request.java:2800)
org.apache.catalina.connector.Request.getParts(Request.java:2643)
org.apache.catalina.connector.Request.getPart(Request.java:2827)
org.apache.catalina.connector.RequestFacade.getPart(RequestFacade.java:1089)
com.jw.designservlet.doPost(designservlet.java:47)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


root cause
org.apache.tomcat.util.http.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
org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:800)
org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:256)
org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:280)
org.apache.catalina.connector.Request.parseParts(Request.java:2734)
org.apache.catalina.connector.Request.getParts(Request.java:2643)
org.apache.catalina.connector.Request.getPart(Request.java:2827)
org.apache.catalina.connector.RequestFacade.getPart(RequestFacade.java:1089)
com.jw.designservlet.doPost(designservlet.java:47)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


note The full stack trace of the root cause is available in the Apache Tomcat/8.0.28 logs.

--------------------------------------------------------------------------------

Apache Tomcat/8.0.28



This is my adddsg.jsp




This is my designservlet.java

 
Miran Cvenkel
Ranch Hand
Posts: 202
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As error says, you should have:
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the ServletsFaq for more information on this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic