我正在使用以下代码来接受我网站上的图像输入
<input type="file" id="qrFile" accept="image/*" />
[在Android上的Chrome上运行正常,但在Chrome上的iPhone上我明白了。知道为什么它不能在iPhone上的Chrome上运行吗?
尝试一下
<input id="myFileInput" type="file" accept="image/*;capture=camera">
var myInput = document.getElementById('myFileInput');
function sendPic() {
var file = myInput.files[0];
// Send file here either by adding it to a `FormData` object
// and sending that via XHR, or by simply passing the file into
// the `send` method of an XHR instance.
}
myInput.addEventListener('change', sendPic, false);