I am having this code:
<input id="video-selector" type="file" name="files[]" accept="video/*,image/*" capture="camera" >
I need to check whether the image is taken from camera or from gallery. Is there any way to do so. Or Is there any option to restrict upload from gallery.
I assume what you want to do is to make sure the user is taking a "fresh" photo.
I don't think there's a way to restrict choosing images from the gallery. But an alternative solution would be: make sure the photo was taken in the most recent few seconds (e.g. 60 seconds).
There is an "original date" property in EXIF info which won't be very easily changeable on phones. You can access EXIF tags easily by JavaScript with the help of exif-js.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With