You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2022/02/21 16:15:40 UTC

[GitHub] [cordova-plugin-file-transfer] Olyster opened a new issue #328: Progress listener Total is 0 with large files

Olyster opened a new issue #328:
URL: https://github.com/apache/cordova-plugin-file-transfer/issues/328


   # Bug Report
   
   ## Problem
   The "total" property of ProgressEvent Interface equals zero
   
   /** Events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>). */
   interface ProgressEvent<T extends EventTarget = EventTarget> extends Event {
       readonly lengthComputable: boolean;
       readonly loaded: number;
       readonly target: T | null;
       readonly total: number;
   }
   
   
   ### What is expected to happen?
   total property should be equal to file size
   
   
   ### What does actually happen?
   total = 0 when downloading large file (tested with 6.6 gig file)
   loaded goes up to the file size so it's not a data type problem.
   
   ## Information
   download a large file (ex: 6 gig) and set onProgress listener
   
   
   ### Command or Code
   let currentProgress
   ft.onProgress((evt:ProgressEvent<EventTarget>)=> {
         currentProgress = (evt.loaded / **evt.total**) <-- currentProgress = "Infinity" since evt.total = 0
    })
   
   
   ### Environment, Platform, Device
   Android 10 - ionic-native - cordova
   
   
   ### Version information
   Android 10
   Cordova 9
   "cordova-plugin-file-transfer": "git+https://github.com/apache/cordova-plugin-file-transfer.git",
   import { FileTransfer, FileTransferObject } from '@ionic-native/file-transfer/ngx';
   Ionic 5.4.15
   Win10
   VSCode Version: 1.56.2 (system setup)
   Electron: 12.0.4
   Chrome: 89.0.4389.114
   Node.js: 14.16.0
   V8: 8.9.255.24-electron.0
   OS: Windows_NT x64 10.0.18363
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org