Código Javascript:
Ver original
<script language="JavaScript"> webcam.set_api_url( 'test.php' ); webcam.set_quality( 90 ); // JPEG quality (1 - 100) webcam.set_shutter_sound( true ); // play shutter click sound </script> <!-- Next, write the movie to the page at 320x240 --> <script language="JavaScript"> document.write( webcam.get_html(320, 240) ); </script> <!-- Some buttons for controlling things --> <br/><form><center> <br> <input type=button value="Configuracion" onClick="webcam.configure()"> <input type=button value="Tomar foto" onClick="take_snapshot()"> </center> </form> <!-- Code to handle the server response (see test.php) --> <script language="JavaScript"> webcam.set_hook( 'onComplete', 'my_completion_handler' ); function take_snapshot() { // take snapshot and upload to server document.getElementById('upload_results').innerHTML = '<h1>Cargando...</h1>'; webcam.snap(); } function my_completion_handler(msg) { // extract URL out of PHP output if (msg.match(/(http\:\/\/\S+)/)) { var image_url = RegExp.$1; // show JPEG image in page document.getElementById('upload_results').innerHTML = '<h1>Imagen Recibida</h1>' + '<h6>Archivo Recibido: ' + image_url + '</h6>' + '<img src="' + image_url + '">'; // reset camera for another shot webcam.reset(); } else alert("PHP Error: " + msg); } </script>
y este otro script que controla el nombre de la foto y la ruta(AMI PARECER) pero no se que ruta poner para guardarla en una carpeta en el escritorio
Código Javascript:
Ver original
<?php /* JPEGCam Test Script */ /* Receives JPEG webcam submission and saves to local file. */ /* Make sure your directory has permission to write files as your web server user! */ $filename = date('YmdHis') . '.jpg'; $result = file_put_contents( $filename, file_get_contents('php://input') ); if (!$result) { print "ERROR: Failed to write data to $filename, check permissions\n"; exit(); } $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/' . $filename; print "$url\n"; ?>
Cualquier respuesta será bienvenida saludos alguna sugerencia?