smartphone photo in the file HTML field

0

Colleagues.

I have a web-based system developed in PHP and this system is compatible mobile. When I click on the file field, it gives the option to use the camera, but when I take a photo, it refreshes the page and does not appear in the field the photo taken. It is possible? If so, could anyone help? Thank you.

    
asked by anonymous 26.03.2016 / 22:52

1 answer

0

This post is very similar to yours. Take a look.

a>

<input id="myFileInput" type="file" accept="image/*;capture=camera">

var myInput = document.getElementById('myFileInput');

function sendPic() {
  var file = myInput.files[0];

  // Send file here either by adding it to a 'FormData' object 
  // and sending that via XHR, or by simply passing the file into 
  // the 'send' method of an XHR instance.
}

myInput.addEventListener('change', sendPic, false);
    
30.03.2016 / 23:39