hiddentao / cordova-plugin-filepath

Resolve native file paths from content URLs for Cordova platforms
Apache License 2.0
66 stars 127 forks source link

Error: column '_data' does not exist #49

Open marvin-SL opened 5 years ago

marvin-SL commented 5 years ago

Hello, I'm sharing file from other apps to my cordova app. When I share from explorer app, i've got the file uri such as : file:///sdcard/Audio/SoundRecorder/2019-03-04%2019-36-03.aac

but when I share from 3rd party app (whatsapp in my example), I don't receive a file uri : content://com.whatsapp.provider.media/item/100492 and then i got “column ‘_data’ does not exist”

    this.filePath.resolveNativePath(receivedFile).then((rslt) => {
          console.log('reslt');
        }).catch((error) => { console.log("error", error) }); //error column '_data' does not exist

ionic info

Ionic:

   ionic (Ionic CLI)  : 4.8.0
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.8

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 6.3.0, browser 5.0.3, ios 4.5.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 1.2.1

System:

   Android SDK Tools : 26.1.1 
   NodeJS            : v8.11.3 
   npm               : 5.6.0
   OS                : Linux 4.15

Can you help me ?

thanks

marvin-SL commented 5 years ago

I did a pull request to fix this https://github.com/hiddentao/cordova-plugin-filepath/pull/53

mpadmaraj commented 5 years ago

@marvin-SL thanks a lot! I had to add <framework src="commons-io:commons-io:2.4" /> in the plugin.xml to make it work though.

marvin-SL commented 5 years ago

Thank you @mpadmaraj ! I will add it to the PR later this day

Edit:Added !

adityamaple1989 commented 4 years ago

@marvin-SL did you find any solution,can you please tell me I am also facing same situation,please reply

marvin-SL commented 4 years ago

@marvin-SL did you find any solution,can you please tell me I am also facing same situation,please reply

Hello, yes here https://github.com/hiddentao/cordova-plugin-filepath/pull/53

adityamaple1989 commented 4 years ago

@marvin-SL Oh thank you so much for your reply, I am getting FileNotFoundException in below line context.getContentResolver().openInputStream(uri),I have already imported files,but I am getting the error

adityamaple1989 commented 4 years ago

@marvin-SL ,I am also getting this error,When I shared the from one third party app to my ionic app,i.e Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference

gaurav112 commented 4 years ago

When do we see a merge for the pr #53 ?