Arimhan
Arimhan

Reputation: 31

FileTransfer.download Error 3 cordova 3.3.0

I have a problem, I tried using Cordova 3.3.0 and when I use the example code in the doc I have everytime an Error type 3. I'm deploying on Android 4.1.2. The permission in the Manifest are ok, for internet and External Storage Write. The device is connected to internet. The plugins are loaded. I don't know what I did wrong. Thanks for your help.

Here is my code:

( JavaScript ):

function start() {
   //test download
   var fileTransfer = new FileTransfer();
   var uri = encodeURI("http://3.bp.blogspot.com/-nc_F5M4_KtY/UhjPnzjacNI/AAAAAAAAAtA/UGGpjdTLT38/s1600/lapin.jpg");
   fileTransfer.download(
    uri,
    "/sdcard/testCordova/file.png",
    function(entry) {
        alert("download complete: " + entry.fullPath);
    },
    function(error) {
        alert("download error source " + error.source);
        alert("download error target " + error.target);
        alert("upload error code" + error.code);
    },
    true,
    {
        headers: {
            Connection: "close"
        }
    }
);

(HTML):

<!DOCTYPE html>
<html>
   <head>
    <link rel="stylesheet" href="style.css" type="text/css">
    <script src="cordova.js"></script>
        <script src="map.js"></script>
        <script>
        function onBodyLoad() {   
        document.addEventListener("deviceready", start, false);
        }   
    </script>
  </head>
  <body onload='onBodyLoad();'>
    <div id="basicMap" class="left"></div>
    <div id="form" ></div>
  </body>

Upvotes: 3

Views: 2496

Answers (1)

fireb86
fireb86

Reputation: 1872

It is a bug of cordova 3.3 (link)

Upvotes: 1

Related Questions