HTML File Input Element & File Chooser


#1

I have a site that I’m trying to wrap in a webveiw. I initially checked this out using the Cocoon Developer App from the Play Store directly entering the url and using webview+. Everything seemed good. I then built a project using the same url and compiled a webview+ version of this and it seemed OK. However I have an issue with file type input elements. I few of the pages of the site have forms that have a file input element. When using these on the developer app I get the standard file chooser popup dialog as expected but on the compiled version I get ‘No apps can perform this action’.

I am curious as to what the dev app is including or doing different that makes the same site work that doesn’t when I compile my own project. Fundamentally I can see that it works on the dev app so there’s got to be something I’m missing here.

Anyone got any ideas?

Thx

Jerry


#2

Hello @jerry,

I would try to add cordova-plugin-file. I’m not sure the plugin is actually needed, but installing it will add the permission in the Manifest that will grant the app access to the storage.

The DevApp in the Play Store has the most used plugins in it.

Regards.


#3

Thank you, Thank you, Thank you, lol

That was it. Everything is working perfectly now :relaxed:

Jerry


#4

One last thing,

You probably will do as fine with the READ_EXTERNAL_STORAGE permission. cordova-plugin-file adds WRITE_EXTERNAL_STORAGE (which implies READ_EXTERNAL_STORAGE) and it’s better to request the smaller one.

Good luck!


#5

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.