Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6923655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:33:47+00:00 2026-05-27T10:33:47+00:00

I have to upload a file ,while iam trying to run showing the message

  • 0

I have to upload a file ,while iam trying to run showing the message

 org.apache.jasper.JasperException: Exception in JSP: /RootSipResource.jsp:33

30:        out.println("Cookies" + request.getCookies());
31:        
32:        DiskFileUpload upload=new DiskFileUpload();
33:        List items=upload.parseRequest(request);
34:         Iterator it=items.iterator();   
35:        while(it.hasNext())  
36:                {          


Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

root cause

javax.servlet.ServletException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
    org.apache.jsp.RootSipResource_jsp._jspService(RootSipResource_jsp.java:577)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

root cause

org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
    org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:768)
    org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:323)
    org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:341)
    org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302)
    org.apache.jsp.RootSipResource_jsp._jspService(RootSipResource_jsp.java:91)

In jsp page the form field set as

<form name="frm" id="frmLoad" method="post" enctype="multipart/form-data">  

isMultipart is printed as true(boolean isMultipart = FileUpload.isMultipartContent(request);)

       `out.println("Content Type ="+request.getContentType());` is printed as null
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:33:48+00:00Added an answer on May 27, 2026 at 10:33 am

    This exception indicates that either method="post" or enctype="multipart/form-data" is missing from the <form> element. But as they are apparently present, the cause lies elsewhere. Perhaps you’re nesting forms, or misinterpreting the results, or not running the code you think you’re running.

    In any way, writing Java code in JSP files should be avoided. Use a servlet. You can find a concrete example in this answer: How to upload files to server using JSP/Servlet?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple question. I'm trying to upload a file to my ftp
I have a upload text file field, and with it I plan to save
I have a file upload form that is being posted back to a servlet
I have a file upload control <input id=File1 type=file /> in my page... How
I have string like this: G:\Projects\TestApp\TestWeb\Files\Upload\file.jpg How can I remove all text before Files
I have a HTML file upload field from which I'm reading the file name
I have implemented a simple file upload-download mechanism. When a user clicks a file
I have an upload form with a file to be uploaded. The issue I
I have a form that excepts a file upload in ASP.NET. I need to
I have an upload script that write a index.html file, I modified it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.