Is there any way to directly open the Photo Library and select photos when clicking on HTML file control on Safari iOS/WebViewController?
I was able to directly open camera and documents (only on iOS 14 devices) from the file control using the following codes.
To open the camera:
<input type="file" name="media_file" accept="image/*, video/*" capture="environment">
And to open the documents:
<input type="file" name="media_file" accept="application/pdf" >
But couldn't open the Photo Library. Instead it is showing the following menu and from there I have to open the Photo Library to chose photos. But I need to open the Photo Library directly without showing the menu. Is it possible?
Is there any way to directly open the Photo Library and select photos when clicking on HTML file control on Safari iOS/WebViewController?
I was able to directly open camera and documents (only on iOS 14 devices) from the file control using the following codes.
To open the camera:
<input type="file" name="media_file" accept="image/*, video/*" capture="environment">
And to open the documents:
<input type="file" name="media_file" accept="application/pdf" >
But couldn't open the Photo Library. Instead it is showing the following menu and from there I have to open the Photo Library to chose photos. But I need to open the Photo Library directly without showing the menu. Is it possible?
Share Improve this question asked Oct 21, 2020 at 7:43 Dipu RajDipu Raj 1,8944 gold badges33 silver badges39 bronze badges3 Answers
Reset to default 1There isn't a direct way through HTML or JavaScript to force the Photo Library to open directly without presenting the initial choice menu.
Frameworks like Cordova or Capacitor might offer plugins or APIs that allow deeper integration with iOS features. Refer to this Capacitor Camera plugin here.
There is no direct way to bypass the options menu and open the Photo Library directly from an HTML file input. This is a limitation of the browser and operating system's handling of file inputs for security and user experience reasons.
No, it is not possible to bypass the menu and directly open the Photo Library on Safari iOS when clicking an HTML file input control. The menu is a security feature designed by iOS to give users control over their file selection.