Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why I can't take image snapshot with client-side camera in Django web application?

I have a Django web application in which I want to give an option to capture the image in the registration form. So, whenever the user presses the capture image button then the camera on the client system should open to take the image, the image then would get stored in the server-side folder.

I am thinking that the camera should open from the HTML page and send the image to the server, but I am not able to open the camera using the HTML code.

Please advise me.

like image 297
PSSR Avatar asked Dec 18 '13 13:12

PSSR


2 Answers

You can use WebRTC for this; html5rocks.com has a nice tutorial, see especially the example of taking screenshots. To store the image on the server, you'll have to upload it via AJAX.

like image 73
sk1p Avatar answered Jan 27 '23 10:01

sk1p


You have several options to access client webcam. The easiest way is HTML5. But you can use sveral tools in silverlight and flash plugin.

See how-to-access-webcam-from-html5 and html5-getusermedia-record-webcam-both-audio-and-video

After getting image in page you can send it to server in diffrent ways including JavaScript (with AJAX) or using HTML form element (like file input)

like image 38
beheshtraya Avatar answered Jan 27 '23 10:01

beheshtraya