无法选择多个图片在Android上上传 - Chrome网络浏览器 [英] Can't select multiple images to upload on Android - Chrome Web Browser

查看:162
本文介绍了无法选择多个图片在Android上上传 - Chrome网络浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Web应用程序,用户可以从手机的图库中选择并上传多个图像。这个函数在iOS上工作正常,但它似乎在Android上被破坏:

 < form action =method = postenctype =multipart / form-data> 
< input type =fileid =filename =files []multiple =multipleaccept =image / */>
< input type =submitvalue =上传! />
< / form>

我已阅读过几篇声称在Chrome浏览器中被修复的帖子,但我仍然可以'b'b

谢谢!

解决方案

这里是我用于桌面的代码:

 < input type =fileid =deviceImagesmultiple accept = .JPG,.GIF,.PNG .JPEG/> 

我们认为我们需要两个,这里是移动的一个:

 < input type =fileid =deviceCameramultiple accept =image / */> 

但我们注意到当您选择桌面链接时,它提供了一个上传选项从 Documents >,这允许通过长按第一次进行多次选择。

但来自mobile(图片/ *)输入它可让您从 Camera 或某些应用程序中进行选择,但不能选择 Documents ,而且您无法使用以便从中选择。



所以现在我只是使用:

 < input type =filemultiple accept =image / * ,. jpg,.gif,.png,.jpeg/> 

这使我可以从 Documents Camera ,但不是任何应用程序,但至少 Documents 允许您选择多个图像。



希望有人知道允许这些应用程序的代码!



更新



我们现在只是使用

 < input type =fileid = deviceImagesmultiple accept =image / *> 

这会为您提供应用程序,但不是 Documents Gallery 并不适合我,因此我开始使用照片,并允许我多选图片。 HTH!

I would like to create a Web App where the user can select and upload multiple images from the phone's image gallery. This function works fine on iOS, but it seems to be broken on android:

<form action="" method="post" enctype="multipart/form-data">
    <input type="file" id="file" name="files[]" multiple="multiple" accept="image/*"/>
  <input type="submit" value="Upload!" />
</form>

I have read several posts where people claim to be fixed in the Chrome Web Browser, but I still can't get it to work.

Thanks!

解决方案

here is the code I was using for desktop:

<input type="file" id="deviceImages" multiple accept=".jpg,.gif,.png,.jpeg"/>

we thought we needed two, here's the one for mobile:

<input type="file" id="deviceCamera" multiple accept="image/*"/>

but what we noticed was that when you choose the "desktop" link it gave you an option to upload from the Documents, and this allowed multiple select by long pressing first.

but from the "mobile" (image/*) input it let you select from Camera or some apps, but not Documents, and you weren't able to multi-select from them.

so now i'm just using:

<input type="file" multiple accept="image/*,.jpg,.gif,.png,.jpeg"/>

this gives me access to select from Documents and Camera but not any of the apps, but at least Documents allows you to select multiple images.

hopefully someone knows code to allow the apps as well!

UPDATE

we are now just using

<input type="file" id="deviceImages" multiple accept="image/*">

this gives you the apps, but not the Documents on my s4. you need to choose the right one for your site, but then the users need to know how to select multiple images based on the app that they use. using Gallery didn't work as well for me, so I started using Photos and that allowed me to multi-select images. HTH!

这篇关于无法选择多个图片在Android上上传 - Chrome网络浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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