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.

John
  • 131
  • 3
  • 11
  • A file upload feature in Android? What do you mean exactly? I do that every day with 4.4. Well not with phonegap. So what do you try to say? – greenapps Dec 02 '14 at 09:09
  • if you mean the input type="file" http://stackoverflow.com/questions/19882331/html-file-input-in-android-webview-android-4-4-kitkat – jcesarmobile Dec 02 '14 at 09:20
  • try creating a plugin. Phonegap has given support to use native functionalities. create a plugin using that. In my project i tried the same for one week yet i cant upload. So i switched to plugin, i made it in a day. – Mohammed Imran N Dec 02 '14 at 09:39

1 Answers1

2

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

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

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

caw
  • 30,999
  • 61
  • 181
  • 291