Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6153305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:04:23+00:00 2026-05-23T20:04:23+00:00

im having a hard time saving the image captured from the webcam using the

  • 0

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

$(document).ready(function(){
    $("#camera").webcam({
        width: 320,
        height: 240,
        mode: "save",
        swffile: "jscam.swf",   
    });

    });

i am using the ‘save’ mode. in the body part..

<div id="camera"></div>
<a href="javascript:webcam.save('upload.php');void(0);">capture</a>

in the upload.php part..

$str = file_get_contents("php://input");
file_put_contents("upload.jpg", pack("H*", $str));

i also tried the callback mode still doesnt work. it seems the blog itself has insufficient examples

http://www.xarg.org/project/jquery-webcam-plugin/

[update]

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 😀

now my only problem is how to save the image. the blog doesn’t clearly specify how. it just gave the codes

webcam.save('/upload.php');

which is honestly i don’t know what to do with it, unlike the php code he gave. should i put it in a link? or edit the onCapture part?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:04:23+00:00Added an answer on May 23, 2026 at 8:04 pm

    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
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a hard time saving my template to a database and download the
I'm having hard time trying to use teasers post in my wordpress theme (based
I am having hard time converting a BasicHttpBinding to custom binding. Specifically I need
Having a hard time figuring out the best way to go about this. What
Having a hard time wrapping my head around this one. I have a Page
i'm having a hard time dealing with MVC Ajax helper and trying to refresh
I'm currently working with some code involving saving a file to a user-defined file.
Several people have commented on my C code here, saying that I should use
Having a strange issue with Visual Studio 2010 Professional (running Windows Vista Home Premium
I'm currently developing a bottle app on GAE, and it's already got its own

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.