jQuery webcam plugin - saving image

前端 未结 1 1119
情书的邮戳
情书的邮戳 2021-01-03 15:13

im having a hard time saving the image captured from the webcam using the jquery webcam plugin. here\'s the code..

$(document).ready(function(){
    $(\"#ca         


        
相关标签:
1条回答
  • 2021-01-03 15:29

    You going to need to do a little PHP Here is a basic upload script, from the JPEGCam project

    <?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( '/path/to/file/store/or/site/' . $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";
    
    ?>
    
    0 讨论(0)
提交回复
热议问题