Content Uri to file URI cordova/phonegap

Viewed 522

This is my Content URI ,I want to convert it to file URI

I am trying to import a attachment from gmail,so i am getting the uri from webintent but that is the content uri,iwanted to convert to file uri

I tried many approaches in various questions but still my code is not able to call get success.I am not understanding whats wrong with my code

window.plugins.webintent.getUri(function(url) {
if(url.startsWith('content://')) {
    // url is the url the intent was launched with
    alert(url);
    window.FilePath.resolveNativePath(url, function(local)
    {   deferred.resolve('file://'+result)
    },function (error)
    {
        alert("error");
    }
    );


});

Its is going into error state

0 Answers
Related