在Mobile Chrome上上传图片表单失败 [英] Upload Picture Form Fails On Mobile Chrome

查看:95
本文介绍了在Mobile Chrome上上传图片表单失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个移动网络应用程序,其中用户电话中的图片起着重要作用。

I'm building a mobile webapp, in which pictures from the user's phone play a significant part.

我有此表格,用户可以在其中将用手机拍摄的照片上传到应用程序的数据库中。我正在使用 CodeIgniter的上传类来进行实际的上传。

I've got this form, in which a user can upload a picture taken from his mobile phone into the app's DB. I'm using CodeIgniter's upload class in order to do the actual uploading.

<form enctype="multipart/form-data" action="myapp/do_upload" method="post" accept-charset="utf-8">
            <input type="file" accept="image/*" capture="camera" name="userfile"></input>
            <input type="submit" value="Submit" class="btn btn-block"></button>
    </form>

问题:

该应用程序在我的台式计算机上运行良好:您选择一个文件,将其上传,如果无法使用,则会引发错误。

The app works great on my desktop computer: You choose a file, it uploads it, and throws an error if it doesn't work.

但是,何时尝试在我的手机(运行Mobile Chrome的Android)上执行相同操作时,提交按钮无法正常工作。

However, when trying to do the same thing on my mobile phone (Android running Mobile Chrome), the submit button refuses to work.

我尝试摆弄属性-没有成功。

I've tried fiddling with the attributes - no success.

有什么想法阻止表单真正起作用?

Any Idea what's stopping the form from actually working?

推荐答案

您的问题在这里

<form enctype="multipart/form-data" action="myapp/do_upload" method="post" accept-charset="utf-8">
            <input type="file" accept="image/*" capture="camera" name="userfile"></input>
            <input type="submit" value="Submit" class="btn btn-block"></button> //wrong
            <button type="submit" value="Submit" class="btn btn-block"></button> //right
    </form>

这篇关于在Mobile Chrome上上传图片表单失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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