title: I'm trying to use a simple webcam capture upload, upload isn't working?
body: <p>UPDATE: </p>
  
  <p>This is the entire code, which I pretty much copied and pasted.</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
  &lt;script language="JavaScript" type="text/javascript"&gt;&lt;/script&gt;
  
  &lt;style&gt;
  
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script&gt;
  Webcam.set({
      width: 320,
      height: 240,
      dest_width: 640,
      dest_height: 480,
      image_format: 'jpeg',
      jpeg_quality: 90,
      force_flash: false
  });
  &lt;/script&gt;
  &lt;div id="web_camera" style="width:320px; height:240px;"&gt;&lt;/div&gt;
  &lt;div id="cam_result"&gt;&lt;/div&gt;
   &lt;script type="text/javascript" src="webcam.js"&gt;&lt;/script&gt;
    &lt;script language="JavaScript"&gt;
     document.addEventListener("DOMContentLoaded", function(event) {
          Webcam.set({
              width: 320,
              height: 240,
              image_format: 'jpeg',
              jpeg_quality: 90
          });
          Webcam.attach( '#web_camera' );
          function take_snapshot() {
              // take snapshot and get image data
              Webcam.snap( function(data_uri) {
                  // display results in page
                  document.getElementById('cam_results').innerHTML =
                      '&lt;h2&gt;Here is your image:&lt;/h2&gt;' +
                      '&lt;img src="'+data_uri+'"/&gt;';
                                  Webcam.upload( data_uri, 'upload.php', function(code, text) {
                                              // Upload complete!
                                              // 'code' will be the HTTP response code from the server, e.g. 200
                                              // 'text' will be the raw response content
                                  });
              } );
          }
     });
    &lt;/script&gt;
  &lt;a href="javascript:void(take_snapshot())"&gt;Take Snapshot&lt;/a&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>I'm using this link </p>
  
  <p><a href="http://mycodingtricks.com/javascript/webcam-api/" rel="noreferrer">http://mycodingtricks.com/javascript/webcam-api/</a></p>
  
  <p>This one looks a lot better but may be the same thing</p>
  
  <p><a href="http://www.html5rocks.com/en/tutorials/getusermedia/intro/" rel="noreferrer">http://www.html5rocks.com/en/tutorials/getusermedia/intro/</a></p>
  
  <p>What I'm concerned about is the data_uri, also the url upload </p>
  
  <p>So the webcam works, shows my face, whatever, but I push this </p>
  
  <pre><code>&lt;a href="javascript:void(take_snapshot())"&gt;Take Snapshot&lt;/a&gt;
  </code></pre>
  
  <p>and nothing happens. I see the little grey box at the bottom left saying javascript:void(take_snapshot()) I'm wondering if I'm supposed to put a parameter... </p>
  
  <p>There can be several problems, I am using domain mapping and the folder may be pointed incorrectly or it could be a file permission problem, I did chown with www-data</p>
  
  <p>This is the upload.php as suggested or rather given by the first link</p>
  
  <pre><code>&lt;?php
      // be aware of file / directory permissions on your server
      move_uploaded_file($_FILES['webcam']['tmp_name'], '/tabdater/uploads/webcam'.md5(time()).rand(383,1000).'.jpg');
  ?&gt;
  </code></pre>
  
  <p>I'd appreciate any help.</p>