?
Solved

multipart/form-data with hidden field

Posted on 2004-04-22
4
Medium Priority
?
379 Views
Last Modified: 2009-07-29
I am trying to implement an upload program using servlet, so I have create a HTML form like this
<HTML>
<FORM ACTION="myUploadServlet" METHOD=POST ENCTYPE="multipart/form-data">
  Which file to upload? <INPUT TYPE=FILE NAME=file1><INPUT TYPE=SUBMIT>
  <input type="hidden" name="action" value="upload_photo">
  <input type="hidden" name="success_url" value="upload_success.html">
</FORM>
</HTML>

But when the form is trying to submit, my servlet didn't get any of the parameter from the hidden field. My servlet is using,
req.getParameter("action") and req.getParameter("success_url") to get those parameter. Please help. Many Thanks !
0
Comment
Question by:clo1
  • 2
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
ID: 10886274
you need to use a multipart parser to handle reading the parameters.
Such as file upload from jakarta
0
 
LVL 92

Expert Comment

by:objects
ID: 10886588
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month17 days, 12 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question