HTML文件上传不显示在Android画廊 [英] HTML File Upload Doesn't Show Gallery on Android

查看:109
本文介绍了HTML文件上传不显示在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆