jhuckaby / webcamjs

HTML5 Webcam Image Capture Library with Flash Fallback
MIT License
2.5k stars 1.11k forks source link

how to upload to server #281

Open eploentham opened 6 years ago

eploentham commented 6 years ago

html ->

                    <script type="text/javascript" src="/css/Webcam.js"></script>
                    <script language="JavaScript">
                            Webcam.set({
                                    width: 320,
                                    height: 240,
                                    image_format: 'jpeg',
                                    jpeg_quality: 90,
                                    flip_horiz: true
                            });
                            Webcam.attach( '#my_camera' );
                    </script>

javascript -> function take_snapshot() { // take snapshot and get image data
Webcam.snap( function(data_uri) { // display results in page document.getElementById('results').innerHTML = '';
Webcam.upload( data_uri, 'upload_pic_patient.php' );
} );
}

php -> move_uploaded_file($_FILES['results']['tmp_name'], 'webcam.jpg');

saineshwar commented 6 years ago

Have you check this Example of PHP :- http://theonlytutorials.com/capture-web-camera-image-php-jquery/

eploentham commented 6 years ago

thank you