I am using input type file for launching the camera in iOS . The following line of code I am using :
<input type="file" name="select a Picture"/>
When I press the button it shows two option i.e. 1) Take a Picture 2. Choose from the gallery If I select option Choose from the gallery then it launches the native gallery when I select the picture from the gallery then I can see it in the preview , so choose from gallery is working fine .
But the problem is with taking picture using camera . When I Press the take picture it launches the camera but it after capturing the photo it directly goes back to the safari . And there is pop of which shows the following error:
A problem occurred with this webpage so it was reloaded
so how to overcome this issue ?
In my case, adding a name="" attribute fixed the problem. I had:
<input id="uploadPhotoInput" type="file" capture="camera" accept="image/*">
and it crashed every time. Changing it to:
<input id="uploadPhotoInput" name="uploadPhotoInput" type="file" capture="camera" accept="image/*">
seems to have done the trick. I have no idea why, since I wasn't submitting it in a form or anything, but there it is.
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