1

I have to send the image statically as an input from HTML page to servlet and get that image at the servlet. I have written the code as

  <form action="servlet" method="get">
     <input type="image" name="somename" src="img/xyz.jpg"> //passed image as a input
    <input type="submit" value="submit">
  </form>

How can I get image into the servlet?

newbee
  • 89
  • 7
  • Input type="image" displays an image on the submit button to submit the form. It does not submit the image itself - the image is just for aesthetics. – SF. Apr 14 '17 at 12:53

1 Answers1

1

I think you might need to take a look at this question. What you are trying to achieve is not possible it seems.

If it is an image you are trying to submit to a server, what you need is <input type='file' ... />. Please clarify if it is otherwise..

Community
  • 1
  • 1
Romeo Sierra
  • 1,666
  • 1
  • 17
  • 35