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

Cordova 3.4.1 + FileTransfer 0.4.0 on iOS 7.1.2 fails to upload large files (> 200MB)

    XMLWordPrintableJSON

Details

    Description

      Cordova 3.4.1 + FileTransfer 0.4.0 on iOS 7.1.2
      Upload file < 250 works, > 250 doesn't work.
      Simple app built from the file transfer sample code.

      https://github.com/Vladimir40491a/myrepository

      Sample code (iOS Simulator test):

      function testUpload() {
         // Get file URL to video file. In this case I used a 520MB file
          var imageURI = "file:///Users/shazron/Downloads/video.mp4";
          var options = new FileUploadOptions();
          options.fileKey = "file";
          options.fileName = imageURI;
          options.mimeType= "video/mp4";
          options.chunkedMode = true;
          
          var ft = new FileTransfer();
          
          ft.onprogress = function(progressEvent) {
              var loaded = Number(((progressEvent.loaded / progressEvent.total) * 100).toFixed(1));
              console.log(loaded);
          };
          
         // upload to local server, use https://github.com/apache/cordova-labs/tree/cordova-filetransfer
          ft.upload(imageURI, encodeURI("http://localhost:8000/upload"), successUploadFileToServ, failUploadFileToServ, options);
      }
      
      function successUploadFileToServ(r) {
          console.log('Success FileTransfer method upload.');
          console.log(r);
          
          navigator.notification.alert('Video file has been successfully loaded', null, 'Upload file', null);
      }
      
      function failUploadFileToServ(error) {
          console.log('Error FileTransfer method upload.');
          console.log(error);
          
          navigator.notification.alert('FileTransfer: Code = ' + error.code + '; Sourse = ' + error.sourse + '; Target = ' + error.target + '; http_status = ' + error.http_status, null, 'Error Upload file', null);
      }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Vladimir40491a Vladimir Mitrokhin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: