how to disable capture when upload image file (using safari on ipad)

拜拜、爱过 提交于 2019-12-23 12:26:28

问题


I would like to upload a image using safari on ipad here is my html code

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

When i try to select a file, safari prompt me to choose "take photo" or "select existed file", how can i disable the "take photo" options, and just select an existing file?

I also look up w3c document, and try codes below, but not work

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

回答1:


According to this HTML5 compatibility comparator, Safari supports only partially the media capture feature: it complies with the accept attribute but ignores the catpure attribute.

So I am afraid you will have to wait for a better support from Safari before it works the way you want...

What's more, according to the W3C specifications:

When the capture attribute is specified, the user agent SHOULD invoke a file picker of the specific capture control type.

The keyword SHOULD means that Safari can choose not to follow the recommendation for some reason and still claim to be compliant with the standard...



来源:https://stackoverflow.com/questions/23234596/how-to-disable-capture-when-upload-image-file-using-safari-on-ipad

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