Capture Webcam Image with PHP and jQuery!

You might have seen many websites having an option of capturing web camera image for profile pictures. Especially Facebook has this feature, either you can upload image from your computer or you can take photo using Web Camera.

Today’s script is about Capturing Image from Web Camera using jQuery and PHP. To do that we are going to use a JavaScript called webcam.js which is developed and uploaded in

The above link also has a Flash file which helps us to connect Web Camera and show it on Webpage.

HTML Part (index.html):

This file shows the Web Camera preview and captures the image and pass it to the PHP file with the help of webcam.js.

PHP part (saveimage.php):


This file captures the raw image data and saves it to a folder:

And that’s it you can easily understand the script by reading the comments given in both the scripts.

For your convenience, here is the DEMO and DOWNLOAD:

demo download

About the Author


Software Engineer, Blogger etc., Visit my Youtube channel - <a href="">Click Here</a>

29 thoughts on “Capture Webcam Image with PHP and jQuery!

Leave a Reply

Your email address will not be published. Required fields are marked *