Trouble with file paths in the cordova file plugin

427 views
Skip to first unread message

Kai Brobeil

unread,
Sep 26, 2016, 10:05:40 AM9/26/16
to phonegap

Here's what I'm doing (using the file plugin and the file transfer plugin):


new FileTransfer().download(
    downloadPath,
    "cdvfile://localhost/temporary/test/",
    (entry) => {
        console.log("done downloading to " + entry.toURL());
    },
    true, // trustAllHosts
    {headers: {}}
);


Apparently, "cdvfile://.../" is not working for me. However, on the manual page, there's an example just like what I'm doing. I don't see how this is supposed to be a relative URI, seems pretty absolute to me.


E/PluginManager( 7657): Uncaught exception from plugin
E/PluginManager( 7657): java.lang.IllegalArgumentException: Relative URIs are not supported.
    E/PluginManager( 7657):     at org.apache.cordova.CordovaResourceApi.assertNonRelative(CordovaResourceApi.java:452)
E/PluginManager( 7657):     at org.apache.cordova.CordovaResourceApi.remapUri(CordovaResourceApi.java:135)
E/PluginManager( 7657):     at org.apache.cordova.filetransfer.FileTransfer.download(FileTransfer.java:743)
E/PluginManager( 7657):     at org.apache.cordova.filetransfer.FileTransfer.execute(FileTransfer.java:185)
E/PluginManager( 7657):     at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
E/PluginManager( 7657):     at org.apache.cordova.PluginManager.exec(PluginManager.java:133)
E/PluginManager( 7657):     at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
E/PluginManager( 7657):     at org.crosswalk.engine.XWalkExposedJsApi.exec(XWalkExposedJsApi.java:40)
E/PluginManager( 7657):     at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
E/PluginManager( 7657):     at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:37)
E/PluginManager( 7657):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/PluginManager( 7657):     at android.os.Looper.loop(Looper.java:135)
E/PluginManager( 7657):     at android.os.HandlerThread.run(HandlerThread.java:61)


Thanks for any advice :)


Edit

I've also tried snippets of this code, with the same result.

Edit 2

I've tried downgrading the plugin because there had been a recent update, didn't solve the issue either.


This is a cross-post because I feel on SO there is not a lot of traffic with cordova users. Sorry for that.

Kerri Shotts

unread,
Sep 26, 2016, 11:01:11 AM9/26/16
to phonegap
XP (and I've also responded): https://forums.adobe.com/thread/2213926

On Monday, September 26, 2016 at 9:05:40 AM UTC-5, Kai Brobeil wrote:
> ...

Reply all
Reply to author
Forward
0 new messages