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 2018/08/08 06:22:58 UTC

[GitHub] matrix0123456789 opened a new issue #238: Large file read error

matrix0123456789 opened a new issue #238: Large file read error
URL: https://github.com/apache/cordova-plugin-file/issues/238
 
 
   When you read file by somethig like
   ```
   var reader = new FileReader();
   reader.onloadend=console.log;
   reader.readAsText(file);
   ```
   and if the file is bigger that CHUNK_SIZE (256kB) it gives you corrupted file: for example reading file that has about 0.5MB i get string, which length is over 800 000 characters (tested on android).
   
   My solution, in **www/FileReader.js** instead of line
   `readSuccessCallback.bind(this, readType, encoding, offset, totalSize, accumulate),`
   put
   `readSuccessCallback.bind(this, readType, encoding, offset, Math.min(totalSize - this._progress, CHUNK_SIZE), accumulate),`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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