I have an HTML5 application that captures a webcam image by the browser which I need to capture and write to the database as a binary.
On the server side, in PHP, I have:
$directory = $img;
$element_img = base64_encode(file_get_contents($directory));
And the capture process in the client, with Javascript, occurs through the onClick event of a button, which after capture sends it to another window that I open in the browser:
function btnCaptura() {
var img = App.canvas.toDataURL("image/png");
window.open(img, "_blank", "menubar=0,titlebar=0,toolbar=0,width=" + App.canvas.width + ",height=" + App.canvas.height);
}
And although it works, that is, the captured image is sent to open window, I need to send that image to PHP so it can be saved to the database, but I can not.
Note: If it is possible to do everything in the same window, without opening a new one, just showing a warning that the image was captured successfully, it would be better.