Cordova - File Transfer not save downloaded file
<p>I have a little problem with File Transfer plugin. I'm trying to use this plugin for save an image in a folder, the success event is trigged, but when I go in the folder where the file could be saved, it result empty.</p>

<pre><code>function downloadAction(link) {
window.requestFileSystem(window.PERSISTENT, 5 * 1024 * 1024, function (fs) {

    console.log('file system open: ' + fs.name);

    var url = 'http://cordova.apache.org/static/img/cordova_bot.png';
    fs.root.getFile('downloaded-image.png', { create: true, exclusive: false }, function (fileEntry) {
        download(fileEntry, url);

    }, fail);

}, fail);}

function download(fileEntry, uri) {

var fileTransfer = new FileTransfer();
var fileURL = fileEntry.toURL();

fileTransfer.download(
    uri,
    fileURL,
    function (entry) {
        console.log("Successful download...");
        window.alert("download complete: " + entry.toURL());
    },
    function (error) {
        console.log("download error source " + error.source);
        console.log("download error target " + error.target);
        console.log("upload error code" + error.code);
    },
    null, // or, pass false
    {
        //headers: {
        //    "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
        //}
    }
);}

function fail (error)
{
    window.alert(error.message);
}
</code></pre>

<p>P.s I dont have access problem, my app allow all origin ... I think ...</p>

<pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;widget id="------------------" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"&gt;
&lt;name&gt;-------------&lt;/name&gt;
&lt;description&gt;
&lt;/description&gt;
&lt;author email="dev@cordova.apache.org" href="http://cordova.io"&gt;
    Apache Cordova Team
&lt;/author&gt;
&lt;content src="index.html" /&gt;
&lt;plugin name="cordova-plugin-whitelist" spec="1" /&gt;
&lt;access origin="*" /&gt;
&lt;allow-intent href="http://*/*" /&gt;
&lt;allow-intent href="https://*/*" /&gt;
&lt;allow-intent href="tel:*" /&gt;
&lt;allow-intent href="sms:*" /&gt;
&lt;allow-intent href="mailto:*" /&gt;
&lt;allow-intent href="geo:*" /&gt;
&lt;platform name="android"&gt;
    &lt;allow-intent href="market:*" /&gt;
&lt;/platform&gt;
&lt;platform name="ios"&gt;
    &lt;allow-intent href="itms:*" /&gt;
    &lt;allow-intent href="itms-apps:*" /&gt;
&lt;/platform&gt;
&lt;allow-navigation href="*" /&gt;
</code></pre>

<p></p>

<p>Maybe I cant access to that path ? I cant create an entity there ? </p>

<p><a href="http://i.stack.imgur.com/Yy1zd.png" rel="nofollow">Output of success callback</a></p>