title: Capture image from webcam and save in folder using PHP and JavaScript
body: <p>Kindly checkout code given below I want to save image in folder in JPG format using PHP and AJAX. Kindly help me I am not able to do it.</p>
  
  <pre><code>function base64_toimage() 
  {
    $('#image').attr("src","data:image/png;base64,"+$.scriptcam.getFrameAsBase64());
  };
  function base64_tofield_and_image(b64) 
  {
      $('#formfield').val(b64);
      $('#image').attr("src","data:image/png;base64,"+b64);
  };
  function changeCamera()
  {
      $.scriptcam.changeCamera($('#cameraNames').val());
  }       
  function onError(errorId,errorMsg) {
      $( "#btn1" ).attr( "disabled", true );
      $( "#btn2" ).attr( "disabled", true );
      alert(errorMsg);
  }           
  function onWebcamReady(cameraNames,camera,microphoneNames,microphone,volume) {
      $.each(cameraNames, function(index, text) {
      $('#cameraNames').append( $('&lt;option&gt;&lt;/option&gt;').val(index).html(text) )
        }); 
      $('#cameraNames').val(camera);
  }
  &lt;/script&gt; 
  &lt;br /&gt;
  &lt;div id="webcam" &gt;&lt;/div&gt;
  &lt;div  style="width:250px;float:left;" &gt;&lt;img src="webcamlogo.png" alt="" style="vertical-align:text-top"  /&gt; 
  &lt;select name="cameraNames" size="1" id="cameraNames" style="width:205px;font-size:10px;height:25px;" onChange="changeCamera()"&gt;&lt;/select&gt;&lt;/div&gt;
  </code></pre>
  
  <p>
  </p>
  
  
              <p></p>