im having a hard time saving the image captured from the webcam using the jquery webcam plugin. here's the code..
$(document).ready(function(){
$("#camera").webcam({
width: 320,
height: 240,
mode: "save",
swffile: "jscam.swf",
});
});
i am using the 'save' mode. in the body part..
<div id="camera"></div>
<a href="javascript:webcam.save('upload.php');void(0);">capture</a>
in the upload.php part..
$str = file_get_contents("php://input");
file_put_contents("upload.jpg", pack("H*", $str));
i also tried the callback mode still doesnt work. it seems the blog itself has insufficient examples
http://www.xarg.org/project/jquery-webcam-plugin/
[update]
finally got it working! i can capture the images. i dug up the source code of the page and added an onload eventlistener on my code :D
now my only problem is how to save the image. the blog doesn't clearly specify how. it just gave the codes
webcam.save('/upload.php');
which is honestly i don't know what to do with it, unlike the php code he gave. should i put it in a link? or edit the onCapture part?