-1

I have a web application written in php on an Apache server. I'm trying to make accept='image/*;capture=camera' work on Android with no success. I've seen may posts related to this issue but they refer to Android apps (e.g., use Cordova). How can import such a library to enable Android users to take a picture and upload the file via Post?

EDIT 1: To clarify, my issue isn't posting the file but rather accessing the camera of the mobile device

EDIT 2: First, apologies for the lack of clarify in my question. Here's more context:

  • I have a web server hosted on a computer in a local network that users can access via Wifi
  • When users access http//192.168.1.1/ on their browser there's a form allowing them to upload a picture taken with their mobile device using <input type='file' id='picture' name='picture' accept='image/*;capture=camera'/>
  • This works perfectly with iOS devices but not on Android devices. On the latter there is a weird behavior, if the user is connected to the local network clicking on the "Choose File" button won't trigger the camera at all. However, once they disconnect from the network it's trigger. I'm at a loss... I don't understand why the form doesn't work as intended when connected. The devices I've tested are all on Android 4 or 7.

1 Answers1

0

Basically what you do is take the image and convert it into bytes. You can then use Android's HTTP handling classes to POST the bytes to your endpoint. The following link demonstrates exactly what you're trying to do: Sending POST data in Android

Shane Sepac
  • 806
  • 10
  • 20