title: PhoneGap Build: cordova.file-transfer download always fails with code 3 on Android
body: <p>It's exasperating.. A few days ago, I was unable to get the Cordova file-transfer Plugin to work with PhoneGap 3.6.3. Now it seems that the issue with the "undefinded" errors has been resolved after I've rewritten the index.js. This is the old issue: <a href="https://stackoverflow.com/questions/27572160/phonegap-build-plugins-not-working-getting-undefined-errors-on-android">PhoneGap Build: Plugins not working (getting &quot;undefined&quot; errors) on Android</a></p>
  
  <p>Now I've encountered a new problem: The download on Android always fails with the following message:</p>
  
  <blockquote>
    <p>FileTransferError</p>
    
    <p>body: null</p>
    
    <p>code: 3</p>
    
    <p>exception: null</p>
    
    <p>http_status: 401</p>
    
    <p>source: "<a href="http://www.hs-bremerhaven.de/fileadmin/images/logo.png" rel="nofollow noreferrer">http://www.hs-bremerhaven.de/fileadmin/images/logo.png</a>"</p>
    
    <p>target: "file:///data/data/de.testapp1374839/files/logo.png"</p>
    
    <p><strong>proto</strong>: Object</p>
  </blockquote>
  
  <p>I already tried adding these featue-tags to the config.xml file:</p>
  
  <pre><code>&lt;feature name="http://api.phonegap.com/1.0/file"/&gt;
  &lt;feature name="http://api.phonegap.com/1.0/network"/&gt;
  </code></pre>
  
  <p>And I provided a wildcard to access external ressources.</p>
  
  <pre><code>&lt;access origin="*"/&gt;
  </code></pre>
  
  <p>This is my updated index.js:</p>
  
  <pre><code>var DR = {
      initialize: function(){
          this.bindEvents();
      },
  bindEvents: function() {
      document.addEventListener('deviceready', this.onDeviceReady, false);
      document.getElementById('download').addEventListener('click', this.downloadFile, false);
  },
  onDeviceReady: function(){
  },
  
  downloadFile: function(){
      console.log("Downloading...");
      var $status = document.querySelector("#fileStatus");;
      var assetURL = encodeURI("http://www.hs-bremerhaven.de/fileadmin/images/logo.png");
      var fileName = "logo.png";
      var DEV_PATH = cordova.file.dataDirectory;
      var fullPath = DEV_PATH + fileName;
      console.log("DEV_PATH " + DEV_PATH);
      $status.innerHTML = "Checking for file";
  
       window.resolveLocalFileSystemURL(fullPath, onFilePresent, downloadAsset);
  
      function onFilePresent(){
          console.log("File already there");
      }
      function downloadAsset() {
          var fileTransfer = new FileTransfer();
          console.log("Downloading: " + assetURL + " to " + fullPath);
  
          fileTransfer.download(assetURL, fullPath, 
              function(entry) {
                  console.log("Success!");
                  onFilePresent();
              }, 
              function(err) {
                  console.log("Error");
                  $status.innerHTML = "Fehler.";
                  console.dir(err);
              });
        } 
     },
    checkFile: function(){
         //todo
    }
  };
  </code></pre>
  
  <p>Any help will be appreciated.</p>