Solved

multipart/form-data with hidden field

Posted on 2004-04-22
4
365 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
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

862 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now