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 8357889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:37:42+00:00 2026-06-09T10:37:42+00:00

I was looking how to add image to the form then I found These

  • 0

I was looking how to add image to the form then I found These codes. While integrating this code I failed because I have other fields in the form to be posted when the form is submitted.

So can you please help me to post for instance a field Lastname along with the file and show how can I get it it( Block of code in the servlet to get the lastname) using the same servlet.

  • 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-06-09T10:37:44+00:00Added an answer on June 9, 2026 at 10:37 am

    You’re mixing Apache Commons FileUpload and Servlet 3.0 @MultipartConfig. Those two are entirely distinct ways to parse multipart/form-data requests. A HTTP request can be parsed only once. So if one of those two ways has already parsed it beforehand, the other way would not be able to parse it anymore and end up with null/empty data.

    You should use the one or the other way to parse the request and not both ways. Apache Commons FileUpload was the "de facto" standard to parse multipart/form-data requests before Servlet 3.0 was introduced (Dec 2009). But since Servlet 3.0 there’s the new @MultipartConfig annotation and the new request.getPart() method which makes Apache Commons FileUpload superfluous.

    When using Apache Commons FileUpload, you should remove the Servlet 3.0 @MultipartConfig and all request.getParameter() lines and extract the "regular" request parameters from the List items instead.

    When using Servlet 3.0 @MultipartConfig, you should remove all code related to Apache Commons FileUpload and use request.getPart() instead to obtain the uploaded file.

    See also:

    • 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'm looking to add double buffering to a drawing function like this. dc =
I'm looking to add new states to a TextView. I chose TextViews because they're
I was recently looking at some code in a book and in the form
In Wordpress.. I'm looking for a way to add the first uploaded image in
I have to add text or background image as DRAFT for report when it
I have a backbutton image (backButton). How can I add it to the back
Looking for the best approach for a non-image CSS Drop Shadow technique. I have
I'm looking for some advice on how to do this. I want to have
Possible Duplicate: How to add background image on iphone Navigation bar? I am looking
I'm looking for a way to add additional information to an image. What I

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.