Online Web Camera


Sahana uses Adobe Flash to provide online web camera interfacing. This provides the user the capability of capturing images of persons, on site and upload them to the required pages. The upload of images happens automatically.

The module developers should use the provided api to show the webcam interface as well as to obtain the uploaded image.

API Functions

The function shn_online_cam($image_id) is available in inc/online_cam/ Once called it will render the flash gui which will communicate with the attached web camera of the client machine. This function should be passed a unique image_id (incase where multiple images are captured in the same page,) because this image_id is used to obtain the uploaded image file.

The function shn_online_cam_get_image_file_name($image_id) can be used to obtain the file name of the uploaded image, by passing the image_id given as mentioned above.

Known Issues

This requires Adobe Flash Player 9 or above to be installed.

This has a drawback when load balancing is implemented, since the file is saved to www/tmp folder. This becomes a problem if one server handles the update and another handles the form post request because the second server will not see the uploaded image, which is in the first server. The solution for this problem is to share the www/tmp among all load balancing servers.

If multiple forms use the same image_id, there would be a problem where uploaded images will override each other for different clients. To avoid this you may need to generate a unique image id based on the session key, current time and a random number. This will avoid overwriting of images by different clients.

QR Code
QR Code dev:onlinecam (generated for current page)