plupload 插件在安卓系统里无法拍照上传, IOS却可以。 如何解决?

 var uploader=new plupload.Uploader({
            runtimes: 'html5,flash,silverlight,html4',
            browse_button : 'uploadImg', //触发文件选择对话框的按钮,为那个元素id
            flash_swf_url : '../../../../../../dist/Moxie.swf', //swf文件,当需要使用swf方式进行上传时需要配置该参数
            silverlight_xap_url : '../../../../../../dist/Moxie.xap', //silverlight文件,当需要使用silverlight方式进行上传时需要配置该参数
            multi_selection: true,
            url: 'http://oss.aliyuncs.com',// 服务器端的上传地址
            filters: {
                mime_types : [ //只允许上传图片文件
                    // { title : "", extensions : "jpg,gif,png,bmp,jpeg" }
                ],
                max_file_size : '5mb', //最大只能上传20mb的文件
                prevent_duplicates : false //不允许选取重复文件
            },
            }

有大神知道怎么在配置里解决这个问题吗?

阅读 4.3k
2 个回答
新手上路,请多包涵

mime_types
现在只能把这个注释掉

This is also true for a lot of older mobile browsers who do not support the 'multiple' attribute of the input='file' element. Browsers who do support it sometimes don't fare well with the 'accept' attribute. And indeed that is before the file selection pickers on android. Some are just not capable of selecting multiple files for a given multiple input, while an other might.

简言之,有些移动端浏览器不支持多选,而有些则支持多选但是 accept 属性表现不佳。accept 就是你问题中设置的 mime_types

这是来自 plupload issues 里的回答,所以至少这个插件是没什么特别好的办法的。要么单选,要么不设置 mime_types

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题