Cordova - File Download not working

264 Views Asked by At

I am facing issues to download images with phonegap + steroids

Here is a simplified version of the code

    var downloadUrl = "http://www.gajotres.net/wp-content/uploads/2015/04/logo_radni.png";
    var imageName = "logo_radni.png";

    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) {
        var fileTransfer = new FileTransfer();

        fileTransfer.download(
            downloadUrl,
            fileSystem.root.toURL() + "/" + imageName,
            function (entry) {
                alert("ok");
            },
            function (err) {
                alert(JSON.stringify(err));
            });
    });

The error is this

{"code":3,"source":"http://www.gajotres.net/wp-content/uploads/2015/04/logo_radni.png","target":"file:///storage/emulated/0//logoradni.png","http_status":401,"body":null,"exception":null}

Error 3 is

3 = FileTransferError.CONNECTION_ERR

I am on wifi

navigator.connection.type = "wifi"

In my config.xml as far as I concern is included

<access origin=".*" />
0

There are 0 best solutions below