android - 输入文件接受 ="image/*"捕获 ="camera"禁止在移动设备上浏览

标签 android html

我有这个 html 行来允许文件上传。现在的问题是,当我在 Android 上尝试时,它允许我从手机浏览。我想完全禁用任何浏览,但只是直接访问相机。我已经设置了 capture="camera"它仍然让我可以选择浏览。该页面是一个php页面。

<form class="form-horizontal" action="ag1.php" method="post" name="form1" id=form1 enctype="multipart/form-data" onSubmit="return validateForm();">

<input type='file' id="sImage" name="sImage" accept="image/*" capture="camera">

最佳答案

为后置摄像头设置 capture="environment" 并为前置摄像头设置 capture="user" 将强制显示摄像头。所以你的代码应该是这样的。

<input type='file' id="sImage" name="sImage" accept="image/*" capture="environment">

让我知道这是否有效。

关于android - 输入文件接受 ="image/*"捕获 ="camera"禁止在移动设备上浏览,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24914334/

相关文章:

javascript - 工作时的 onclick 事件,有时两个表之间会发生冲突

java - java android应用程序和PHP脚本之间交换数据最安全的方法?

android - 应用于 ImageView 的 TranslateAnimation 留下痕迹

java - 在 Android 的 SurfaceView 上添加图像

html - 如何像表格一样设置 div 的样式(每个 SharePoint 附带的示例)?

javascript - 使用 &lt;input type ="file"> 读取本地文件?

jquery - 带有html5的简单可拖动弹出窗口

html - 页面标题标签是否应该用于单个标签页

android - 无法使 Jetpack Compose 重新组合

android - 在 View 级别抑制 lint 警告