Capacitor File Browser

Good day. I’m currently using Capacitor and Vue.js to play around mobile development. I’ve researched for days now and unfortunately I can’t any Capacitor plugin that I can use to browse for files, specifically for Android. Do you have any ideas where I can find one? My last option is to use a Cordova file browser as I came from Cordova world and is switching to Capacitor. But if there Capacitor plugins out there that can help, it would be great. Thanks!

This will work specifically for Android - https://ionicframework.com/docs/native/file-chooser

Just follow the instructions for using a plugin in React - https://ionicframework.com/docs/native/community#react

npm install cordova-plugin-filechooser
npm install @ionic-native/file-chooser
ionic cap sync

Thanks for the quick reply! And also sorry for my late reply, seems that the system won’t allow me to send replies quickly, so I waited for 10 minutes before replying.

Anyway, I’m not using React though. I’m using Vue.js. Will it also work with Vue.js? If it is, I’ll give it a try tonight.

Yes the same approach will work, see my github repo or YouTube for specific examples.

Good day. I’ve been busy with work that I just tested the plugin today. Anyway, when I run the app, I encountered this error:

 ERROR  Failed to compile with 1 errors                                                                                                                                            
This dependency was not found:
* @angular/core in ./src-capacitor/node_modules/@ionic-native/file-chooser/ngx/index.js
To install it, you can run: npm install --save @angular/core

Do I really need to install @angular/core even though I’m using Vue.js? I also checked your Github projects and YouTube tutorials but I can’t find anything related to the filechooser plugin. thanks :wink:

I did install it anyway to test and works like a charm! Thank you very much for your time and effort. Appreciated it :wink:

glad it worked out for you

Yeah. there are just warnings on System.import() deprecation but well it’s just warnings. :wink: Btw is there any way i could use cordova-plugin-filechooser without depending on @angular/core?

there should be, i dont run into that issue when using plugins in any of the other projects i use them in?

Can you show what your imports look like

It’s ok now. I’ve switched with this plugin -> https://github.com/codewaseem/capacitor-filepicker-plugin. They do the same thing but it’s way cleaner now that I don’t get any warnings and it does not require me to install the @angular/core dependency.

I hope it would be of use for other users as well. Cheers!

2 Likes