webcam-easy | javascript access webcam stream and take photo | Camera library
kandi X-RAY | webcam-easy Summary
kandi X-RAY | webcam-easy Summary
This is a javascript library for accessing webcam stream and taking photos. You can easily add it as a module to your own app.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of webcam-easy
webcam-easy Key Features
webcam-easy Examples and Code Snippets
Community Discussions
Trending Discussions on webcam-easy
QUESTION
I want to save a base64 image on a php server. I am using webcam-easy (https://github.com/bensonruan/webcam-easy). I inserted a a simple button on the index.html of his demo:
...ANSWER
Answered 2020-Jun-25 at 15:50There are some issues with your code.
Wrong parameterThe first issue is that you post the data as imgBase64
but are trying to get it with $_POST['upload'].
Since you're not posting anything named upload
, your if-statement: if (isset($_POST['upload']))
will always evaluate as false and your code inside the if will never be executed.
Use $_POST['imgBase64']
instead.
If you look at the beginning of the posted string, it probably starts with something like: data:image/jpeg;base64,
(it's the js function toDataUrl()
that adds that).
That is not part of the base64 encoded data so you need to remove that part from the string before trying to decode it.
It should be something like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install webcam-easy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page