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

CDVFileTransfer - handling big files >2GB is not correct

    XMLWordPrintableJSON

Details

    Description

      Hello Cordova Team,

      we needed to download big files (>2GB) via FileTransfer and use the onProgressEvent to display the progress.
      On Android everything is fine. On iOS the reported sizes in the onProgressEvent are not valid, if the downloaded file is larger than 2GB:
      CDVFileTransfer uses NSInteger for bytesTransfered and bytesExpected. NSInteger only is up to 2G-1 as mentioned here: http://stackoverflow.com/questions/2107544/types-in-objective-c-on-iphone

      We patched the library files CDVFileTransfer.h and CDVFileTransfer.m of version 2.9.0 to use "unsigned long long" - now we are able to display downloads up to 16Exabytes-1byte correctly. We can see in github, that version 3.0.0 has the same issue.

      I will add the diff in the issue after creating it.

      Attachments

        1. CDVFileTransfer.h.diff
          1 kB
          Klaus Schmidt
        2. CDVFileTransfer.m.diff
          5 kB
          Klaus Schmidt

        Activity

          People

            agrieve Andrew Grieve
            disy Klaus Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: