Solved

multipart/form-data with hidden field

Posted on 2004-04-22
4
364 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Java virtual machine monitoring tools 3 40
parentbit challenge 3 52
strCopies  challenge 17 74
maven example error 3 36
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…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

747 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

14 Experts available now in Live!

Get 1:1 Help Now