Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-6641

File-Transfer Timeout Error

    XMLWordPrintableJSON

Details

    Description

      I recently upgraded to cordova 3.4.0 and have experienced a few problems with the file-transfer plugin. the most recent problem is stated below and i must stress this worked seamlessly with 2.9 using the same javascript code.

      My application downloads a number of files one after the other. This can be up to 2000 images in a sequence. after downloading some files i get an inconsistent timeout error from the plugin. I know it inconsistent because if i re-run the same same script the files it has problems with are different. I've checked the Webserver and all looks ok. Like i stated above this worked fine before.

      function doDownload(path) {

      window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fileSystem) {
      fileSystem.root.getFile(path,

      { create: true, exclusive: false }

      , function (fileEntry) {
      var localPath = fileEntry.toURL();
      var url = encodeURI(remoteFile);

      var ft = new FileTransfer();
      ft.onprogress = function (progressEvent) {
      if (progressEvent.lengthComputable) {
      var perVal = parseInt((progressEvent.loaded / progressEvent.total) * 100);
      $("#progressbar").progressbar(

      { value: perVal }

      );
      perVal = null;
      } else { }
      };
      ft.download(url,
      localPath,
      function(complete)

      { //Download next file loop; }

      ,
      function(error)

      { //Error here.. }

      ,
      false);
      }, fail);
      }, fail);

      };

      Log dump:-

      2014-05-06 13:44:45.434 Sense-it3.4.0[1716:1023b] File Transfer Finished with response code 200
      2014-05-06 13:44:45.974 Sense-it3.4.0[1716:52007] File Transfer Finished with response code 200
      2014-05-06 13:44:46.063 Sense-it3.4.0[1716:1023b] File Transfer Finished with response code 200
      2014-05-06 13:44:46.333 Sense-it3.4.0[1716:1023b] File Transfer Finished with response code 200
      2014-05-06 13:44:46.352 Sense-it3.4.0[1716:6e0f] File Transfer Finished with response code 200
      2014-05-06 13:44:46.663 Sense-it3.4.0[1716:52007] FileTransferError {
      body = "";
      code = 3;
      "http_status" = 0;
      source = "http://xxx/Video131.PNG";
      target = "file:///var/mobile/Applications/CAC2F5C4-A6CE-4C84-B181-80EB0EC05863/Library/files/1/3748/1/_pointImages/22/Video131.PNG";
      }
      2014-05-06 13:44:46.664 Sense-it3.4.0[1716:52007] File Transfer Error: The request timed out.
      2014-05-06 13:44:46.668 Sense-it3.4.0[1716:6e0f] FileTransferError {
      body = "";
      code = 3;
      "http_status" = 0;
      source = "http://xxx/Video128.PNG";
      target = "file:///var/mobile/Applications/CAC2F5C4-A6CE-4C84-B181-80EB0EC05863/Library/files/1/3748/1/_pointImages/22/Video128.PNG";
      }
      2014-05-06 13:44:46.687 Sense-it3.4.0[1716:6e0f] File Transfer Error: The request timed out.
      2014-05-06 13:44:46.668 Sense-it3.4.0[1716:52007] FileTransferError {
      body = "";
      code = 3;
      "http_status" = 0;
      source = "http://xxx/Video126.PNG";
      target = "file:///var/mobile/Applications/CAC2F5C4-A6CE-4C84-B181-80EB0EC05863/Library/files/1/3748/1/_pointImages/22/Video126.PNG";
      }
      2014-05-06 13:44:46.693 Sense-it3.4.0[1716:52007] File Transfer Error: The request timed out.
      2014-05-06 13:44:46.849 Sense-it3.4.0[1716:5f103] File Transfer Finished with response code 200
      2014-05-06 13:44:47.052 Sense-it3.4.0[1716:6e0f] File Transfer Finished with response code 200
      2014-05-06 13:44:47.372 Sense-it3.4.0[1716:6e0f] File Transfer Finished with response code 200

      Attachments

        Activity

          People

            Unassigned Unassigned
            Na21han Nathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: