File chooser to choose docx,pdf file from browsing local storage in phonegap cordova android application

Viewed 2106

I have tried these plugins for phonegap cordova android app

https://github.com/cdibened/filechooser

github.com/don/cordova-filechooser

but unable to install them in my application, getting error like this;

Error: Failed to fetch plugin https://github.com/cdibened/filechooser.git via registry.

I want to add functionality to upload pdf or doc file from phonegap to server but I unable to do that I know there is a filetransfer plugin but it only allows me to browse media like image or videos but not document files.

Please, it would be great if anyone help me to do that

I'm stuck here.

2 Answers

I believe you are using Cordova Version 7 where is there is a major change related to fetch. You may check out more info on this official link

So you have to use the following command to install the plugin:

cordova plugin add https://github.com/cdibened/filechooser.git --nofetch

The --nofetch flag gives you the pre-Cordova@7.0 behavior

Thanks Gandhi for a reply but I tried that trick earlier but no succeed!

I have resolved this issue by adding this plugin finally, now I can choose a pdf from mobile local storage and upload it to the server using Filetransfer plugin, If anyone want the source code , I will upload it here

Plugin link:

https://www.jsdelivr.com/package/npm/cordova-plugin-file-chooser

cmd: cordova plugin add cordova-plugin-file-chooser

Related