HTML文件上传不显示在Android画廊 [英] HTML File Upload Doesn't Show Gallery on Android
问题描述
我想我的PHP应用程序,以接受来自移动用户的相册选择照片。我使用的是Chrome浏览器在Android 4.4.4测试。这是我的方式:
I'd like my PHP app to accept a photo chosen from a mobile user's gallery. I'm testing on Android 4.4.4 using Chrome. This is my form:
<form enctype="multipart/form-data" action="index.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="20000000" />
<input type="submit" value="Add" />
</form>
我已经尝试了三种不同 TYPE =文件
输入,没有人给我的画廊作为一个选项:
I've tried three different type="file"
inputs and none of them give me the Gallery as an option:
<input name="userfile" type="file" />
选项:照相机,摄像机,录音机和文档
Options: Camera, Camcorder, Sound Recorder and Documents
<input name="userfile" type="file" accept="images/*" />
选项:相机和文档
Options: Camera and Documents
<input name="userfile" type="file" accept="images/*" capture />
直接进入相机。
Goes straight into Camera.
有没有一些直接的方式来获得画廊拿出作为一个选项,或者我必须做一些迂回的东西使用JavaScript?谢谢您的回答。
Is there some straight-forward way to get Gallery to come up as an option or do I have do some round-about thing using JavaScript? Thanks for your answers.
推荐答案
的原来这是Android的> = 4.4 一个已知的bug。我的code工作如预期中的iOS。
Turns out this is a known bug in Android >= 4.4. My code works as expected in iOS.
这篇关于HTML文件上传不显示在Android画廊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!