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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:31:26+00:00 2026-05-20T05:31:26+00:00

I have the following html form… <html> <head><title>Upload Servlet</title></head> <body><h2>Upload Servlet</h2> <form name=’uploadparams’ enctype=’multipart/form-data’

  • 0

I have the following html form…

<html>
<head><title>Upload Servlet</title></head>
<body><h2>Upload Servlet</h2>

<form name='uploadparams' enctype='multipart/form-data' action='' method='post'>
    <label>Migrate Options From:
        <select name='migrateFrom'>
            <option></option>
            <option value='version 1'>version 1</option>
        </select>
    </label>
    <br/>
    <input type='file' name='zipFile'>
    <br/>
    <input type='hidden' value='willnotshowupinservlet'/>
    <button type='submit'>Submit</button>
</form>
</body>
</html>

The problem is that while I can read the file with a http parameter name of “zipFile” just fine my servlet does not see the other parameters “willnotshowupinservlet” and “migrateFrom”. Are file upload forms only able to have one input (the file input)?

  • 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-20T05:31:27+00:00Added an answer on May 20, 2026 at 5:31 am

    They are indeed not available as regular request parameters because you’ve set the form encoding to multipart/form-data (which is indeed mandatory in order to be able to include file content in the request body). You have to parse the request body conform the multipart/form-data specification. The getParameter() calls of Servlet API only supports a form encoding of application/x-www-form-urlencoded which is the default enctype of a HTML <form> element.

    A commonly used API to ease the job is Apache Commons FileUpload. Or, when you’re already on Servlet 3.0, you need to annotate the servlet with @MultipartConfig. You can find concrete examples of both approaches in this answer.

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

Sidebar

Related Questions

I have the following html code : <form name=uploadForm action= method=POST enctype=multipart/form-data> <input type=file
I have the following html: <html> <head></head> <body> <form> <input id=msg type=text value=oldValue />
I have the following html: <body> <form action=site1> <input type=image name=submit border=0 src=images/front/search_travel.png alt=
I have the following html: <html> <body> <form runat=server> Name: <input type=text name=name />
Suppose I have the following HTML: <form id=myform> <input type='checkbox' name='foo[]'/> Check 1<br/> <input
I have following code in a html form <select name=category class=input onchange=ShowTB(this,'suggest');> <option value=0
I have following HTML: <form action=/Config.aspx/SDKHome/SaveSections id=SaveSections method=post> <input name=[0].SchemaName type=hidden value=contactSection /> <ul
i have the following html code : <FORM name=frmmail> <input id=dochtmlContent type=hidden name=dochtmlContent value=oldValue/>
I have the following files: view.jsp <@ page import=... <bean:define id=mForm name=myForm type=MyForm/> <html:form
I have following html form: <form method=post action=> <input type=hidden name=userid id=user value=<?php echo

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.