HTML input file on iOS app, disable “take photo” option

别来无恙 提交于 2019-12-10 01:11:51

问题


I want to disable the "Take Photo" option in an iOS app (WKWebView based) and force users to select photos from library or iCloud.

I can force users to use the camera by the capture boolean attribute:

<input type="file" accept="image/*" multiple capture>

But, I can't found anything similar to do exactly the opposite (disable camera). Is that possible with any other HMTL attribute or a different value for capture?

Similar question was asked here: How to disable take photo on file input iOS 6, but the proposed solution:

We can also request multiple files using the HTML5 new boolean attribute. In this case, the user can’t use the camera as a source.

doesn't work for me (I tried with iOS 9+).


回答1:


There is no way to do this with IOS. The best solution would be to block the photo if it was just taken. You can check the date of the photo and if it was within the last minute you know it was just taken and not uploaded. It is a bit inconvenient due to the fact that users have to upload the photo then have it blocked. There is no way to disable the camera.



来源:https://stackoverflow.com/questions/44678685/html-input-file-on-ios-app-disable-take-photo-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!