HTML5 Select photos directly from Photo Library on Safari iOS
Asked Answered
K

3

12

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?

iOS file menu

Keefe answered 21/10, 2020 at 7:43 Comment(0)
B
1

There 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.

Blakeley answered 11/6 at 7:24 Comment(0)
D
1

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.

Dominicdominica answered 11/6 at 8:9 Comment(0)
F
1

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.

Florous answered 11/6 at 16:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.