Title: JSP:how do i store image from HTML img tag to database as blob
Tags: java;mysql;jsp
Question: I have one web application for capturing image from webcaam using flash player.
after capturing image from webcam I am displaying it's preview in HTML img tag and also capturing image url in hidden form fields which I am using to store that image in my database. But my query is how do I store that image from that image tag as blob in my database and most of the solution I reviewed in that I found of storing image in database were uploading image from system and then storing and retrieving it from databse.



Here is another answer: In order for this to work, you need to create a ```<form enctype="multipart/form-data"&gt;``` . In your html, insert a file upload control. Then you have to select the file to upload (this cannot be done automatically because of security reasons in most browsers). And then submit your form. 

When form is submitted, you can read image from request and store it to db ( how to upload a image in jsp and store database as blob )

Comment for this answer: you can only send data to a server using a form. Data submitted with the form are only of type . The  tag is not supported
Comment for this answer: :I know this way of storing image in database , I would want to know how to store image if I have image in my form HTML img tag.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2012:00:09/14/12', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<java><mysql><jsp>', 'Title': 'JSP:how do i store image from HTML img tag to database as blob', 'ViewCount': 1486, 'id': 12418831, 'user_AboutMe': None, 'user_AccountId': 1652904.0, 'user_DisplayName': 'yatinbc', 'user_Reputation': 565.0, 'user_Views': 129.0, 'user_id': 1523127.0}}