문제

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">
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top