gpt4 book ai didi

html - 上传图像文件时如何禁用捕获(在 ipad 上使用 safari)

转载 作者:搜寻专家 更新时间:2023-10-31 08:18:23 25 4
gpt4 key购买 nike

我想在 ipad 上使用 safari 上传图片这是我的 html 代码

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

当我尝试选择一个文件时,safari 提示我选择“拍照”或“选择现有文件”,如何禁用“拍照”选项,只选择一个现有文件?

我也查了w3c文档,试了下面的代码,还是不行

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

最佳答案

根据这个HTML5 compatibility comparator ,Safari 仅部分支持媒体捕获功能:它符合 accept 属性但忽略 catpure 属性。

因此,恐怕您将不得不等待 Safari 提供更好的支持,然后才能按您想要的方式运行...

此外,根据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意味着 Safari 可以出于某种原因选择不遵循建议并仍然声称符合标准...

关于html - 上传图像文件时如何禁用捕获(在 ipad 上使用 safari),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23234596/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com