Skip to content

Conversation

@t-walker-wei
Copy link

Add form data, request headers when upload snap.
Call: Webcam.upload(image_data_uri, target_url, post_data, callback, headers)
post_data and headers are js objects and optional.

@bgxerjoe
Copy link

bgxerjoe commented Aug 8, 2021

in Laravel you must add csrf_token() to prevent page expired (419 error)

function saveSnap(){
var base64image = document.getElementById("imageprev").src;
Webcam.upload( base64image, 'url',{ _token: "{{csrf_token()}}"}, function(code, text) {
document.getElementById("id_image").value = text;
});
} #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants