Recommended Android/IOS file chooser plugin

Hello,
I tried the code you provide and I get the file browser to show up and I can pick a file. However, the callback is not getting triggered…

I see this error in the android console
W/CordovaInterfaceImpl: Got an activity result, but no plugin was registered to receive it

I am using cordova 6.3.1 and SDK 23 android 5.2.2

Thanks for your help.

I’ll have a look at it, right now I’m traveling but I’ll be in a hotel with Wifi tonight, will have a look when I have some time …

Hello Leob,

Just checking to see if you had a moment to look into this issue…

Thanks

Not yet but it’s in my inbox, I’ll get around to it.

Will Same plugin work on Ionic 2, I am trying the same for Ionic 2 but getting the following error on real device
[Error] EXCEPTION: undefined is not an object (evaluating ‘a.plugins.fileChooser.open().then’)

FilePicker is Available & returning true, Following is my code

fileChooser = {
open () : Promise {
console.log(‘FilePicker will Load in new Way’);
return FilePicker.pickFile().then((uri) => {
return uri;
}, (err) => {
console.log(‘Failed to Load’);
});
},
}

Well, for Android I’m using the file chooser plugin but for iOS I’ve switched from the “FilePicker” plugin to a simple HTML5 “file” input element, which turns out to be easier to use AND functionally superior … see here how to implement it:

Actually I did not literally use the code from the gist, I still had to make a few changes to get it working properly (with the code from the gist the “onchange” event didn’t always fire). If anyone is interested in my final solution then I can post it here.

And for iOS 9 and higher you need to configure “entitlements” (for iOS 10 therre’s even an additional requirement), all in all I think I spent the better part of a week just to get the iOS solution working!

How to upload multiple files of different types in one go using file chooser?plz help…

After adding this plugin
ionic plugin add https://github.com/jcesarmobile/FilePicker-Phonegap-iOS-Plugin.git
and then installing it
npm install FilePicker-Phonegap-iOS-Plugin
I’m not able to import FilePicker . It still giving me an error “Cannot find FilePicker”.

I don’t know whats the issue?
I’m using ionic v2 . May be this plugin doesn’t support the latest version.
Need help?

For file operations, I was advised to use the ‘cordova file plugin’, because it has a large codebase to work with, and understand most of the deal, whatever os (android or ios).

It returns an array if the call is nice, and seems to work well with Ionic 2.

The “File” plugin allows you to work with files, however it does not give you a user interface to select a file … you can (in principle) use the low level file operations to build your own user interface, but to make it user friendly is a tough job, instead you really want to invoke a native file chooser dialog … once the user picked a file, then you can use the File plugin to work with it.

For android we import From "import { FileChooser } from ‘@ionic-native/file-chooser’; "

and installed plugins of filechooser

$ ionic plugin add --save http://github.com/don/cordova-filechooser.git
$ npm install --save @ionic-native/file-chooser

**Could anyone please tell me that from where we will import FilePicker for IOS and from where we will install the plugins for Filepicker in ionic 2 **

This is Ionic 2, I have no opinion on that … the solution I worked on is only for Ionic 1.

@mhartington

Is there now any solution for File chooser for IOS in ionic ??

@vinaysingh7733
did you find any solution ?

@vinaysingh7733
I am facing similar problem, I don’t know how to import the plugin,did you solve the issue on how to use the plugin in ionic v2. Also I wanted to know does this plugin help to choose files from mobile storage or only from iCloud?

Yes I have solved that problem

use this plugin : https://github.com/jcesarmobile/FilePicker-Phonegap-iOS-Plugin

@abhisheklamrood

in your .ts file declare

declare var FilePicker: any

and you would be able to use this plugin.
this plugin will allow your app to pick files from your iCloud

@ShehramTahir Thank you very much

1 Like

Hello,
I am using this plugin, and just managed to implement it successfully, but I am only able to fetch files from iCloud storage, how can I fetch files from mobile storage using this plugin. Can anyone share their code for this plugin in Ionic 2

I’ve implemented a file chooser based on the above in my Ionic v1 project.
It works great on iOS and Android v4.1.2.
However, on devices running Android v5 or v6, the call to fileChooser.open() doesn’t seem to do anything.
Any ideas? I’ve searched for solutions but can’t find any way to fix it.