文件上传不工作的Andr​​oid 4.4.2文件上传、工作、Andr、oid

2023-09-07 18:09:41 作者:浪费了青春。

我已经创建了使用PhoneGap的一个应用程序。该应用程序正常工作的所有的Andr​​oid版本。但在这个应用程序中的文件上传功能不能在Android 4.4.2工作。我用Google搜索了很多关于这个问题,我所发现的是,谷歌已禁用此功能为Android 4.4.2。

I have created an app using phonegap. The app works fine on all android versions. But the file upload feature on this app does not work on Android 4.4.2. I have googled a lot on this issue, and all I have found is that Google has disabled this feature for Android 4.4.2.

有没有变通解决呢?我真的需要一个解决这个问题的。这将是巨大的帮助,如果有人能提出一个解决这个问题。

Is there no work around at all? I am really in need of a solution to this problem. It would be great help if someone can suggest a solution to this issue.

推荐答案

有没有机会得到上传文件的的WebView 在Android 4.4.2的工作。

There's no chance to get file uploads working in a WebView on Android 4.4.2.

不过,的onclick 的onchange 事件仍在开火的<输入TYPE =HTML> 元素

Nevertheless, the onclick or onchange events are still fired on the <input type="html"> element.

这意味着您可以通过JavaScript获得文件存在,或致电从这些事件处理Java方法和手动完成文件上传。

This means you can either get the file there via JavaScript or call a Java method from those event handlers and do the file upload manually.

有关科尔多瓦,有一个问题在这里:

For Cordova, there's an issue here:

https://issues.apache.org/jira/browse/CB-5294

...和解决方法在这里:

... and a workaround here:

https://github.com/cdibened/filechooser