Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including jquery-photo-uploader with all npm packages installed. Try it out:

jquery-photo-uploader lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("jquery-photo-uploader/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

jquery-photo-uploader v1.0.13

jQuery Plugin for uploading local photos and capturing from a webcam

jQuery Photo Uploader

jQuery Plugin for uploading local photos and capturing from a webcam

plugin preview

Run Conditions

PhotoUploader detects whether webcam capture is possible.

  • If webcam capture is possible, then the use may choose between file upload, or live capture
  • If webcam capture is not possible, then the user may only choose to upload a file.

Usage

DOM

PhotoUploader requires an empty <div> element on which to bind.

JavaScript

PhotoUploader must be initialized on the result of a jQuery Selector before use.

  window.YourApp.photoUploader = $("#photoUploader").PhotoUploader({
    url: window.YourApp.root + "/APIEndPointForPOST",
    maxPhotoSize: "2MB"
   });

To display a PhotoUploader, simply call the show() function of the already initialized PhotoUploader.

  $("#uploadImageButton").click(function(){
    window.YourApp.photoUploader.show();
  })

Server Side

PhotoUploader will POST the captured / selected image as a Base64 Encoded png to the endpoint defined by the url option.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free