I have a iOS and Android application, and I load a external website inside my app (this external website is mine too). My problem is that this website has a file upload feature and this feature does not work on Android (it works on iOS). I saw that this behavior is normal on Android, but is there any way to make it work or it's definitely not an option ? Thank you
EDIT 1
I tried to create a new app with a simple page like this (hosted on AWS) :
<html>
<head>
<title>Upload Test !</title>
</head>
<body>
<div>Upload Test</div>
<div>
<input type="file" id="imgFile" name="files[]" accept="image/x-png, image/gif, image/jpeg">
</div>
</body>
and I added this script in my generated index.html in my Cordova project.
<script type="text/javascript">
document.addEventListener("deviceready", function(event) {
console.log('TEST CONSOLE LOG !');
var url = 'https://s3-eu-west-1.amazonaws.com/***/file-upload.html';
ref = window.open(url, "_blank", "location=no,toolbar=no,zoom=no,hidden=yes");
ref.addEventListener('loadstop', function () {
ref.show();
});
ref.addEventListener('loaderror', function () {
ref.close();
ref = undefined;
});
}, false);
</script>
It doesn't work on my nexus 5 (android M).
There's an issue with both Android and iOS that prevents file uploads when clicking on a file input tag like this within the inappbrowser:
There's a couple of fixes for both which I've consolidated into a single location to make it easy for anyone else facing this issue. You should be able to modify your config.xml file to use it by including this:
Instead of the default inappbrowser plugin.
More details can be found here: https://github.com/jverlee/cordova-plugin-inappbrowser-camera
@Verl
's code is pretty good! However, it cannot be installed through his installation guide... So here is mine:By the way, if I follow his guide, I only gets: Error: Cannot read property 'variables' of undefined