title: jQuery webcam plugin - saving image
body: <p>im having a hard time saving the image captured from the webcam using the jquery webcam plugin. 
  here's the code..</p>
  
  <pre><code>$(document).ready(function(){
      $("#camera").webcam({
          width: 320,
          height: 240,
          mode: "save",
          swffile: "jscam.swf",   
      });
  
      });
  </code></pre>
  
  <p>i am using the 'save' mode. in the body part..</p>
  
  <pre><code>&lt;div id="camera"&gt;&lt;/div&gt;
  &lt;a href="javascript:webcam.save('upload.php');void(0);"&gt;capture&lt;/a&gt;
  </code></pre>
  
  <p>in the upload.php part..</p>
  
  <pre><code>$str = file_get_contents("php://input");
  file_put_contents("upload.jpg", pack("H*", $str));
  </code></pre>
  
  <p>i also tried the callback mode still doesnt work. it seems the blog itself has insufficient examples </p>
  
  <p><a href="http://www.xarg.org/project/jquery-webcam-plugin/" rel="nofollow">http://www.xarg.org/project/jquery-webcam-plugin/</a></p>
  
  <p>[update]</p>
  
  <p>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 </p>
  
  <p>now my only problem is <strong>how to save the image</strong>. the blog doesn't clearly specify how. it just gave the codes </p>
  
  <pre><code>webcam.save('/upload.php');
  </code></pre>
  
  <p>which is honestly i don't know what to do with it, unlike the php code he gave. should i <strong>put it in a link</strong>? or <strong>edit the onCapture part</strong>?</p>