Skip to content Skip to sidebar Skip to footer

How To Put Captured Image From Webcam Into Input File

I'm trying to upload images from webcam, but I'm not sure how to assign captured image into input file field. Here is the code: I have to put the canvas image into my input file f

Solution 1:

To capture images from user's camera you can use the capture attribute set to user.

Just like this:

<label for="theImageFile">Upload photo from live camera:</label>
<input type="file"id="theImageFile" capture="user" accept="image/*">

Read more about it here: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture

Post a Comment for "How To Put Captured Image From Webcam Into Input File"