ataylor32 edited a comment on pull request #461:
URL: 
https://github.com/apache/cordova-plugin-file/pull/461#issuecomment-947017857


   @LightMind Regarding this quote from my previous comment:
   
   > So I switched to the code from 
https://github.com/LightMind/cordova-plugin-file/blob/master/www/FileWriter.js
   
   That wasn't a typo. I used the code from your fork's `master` branch. But 
what I ultimately ended up doing instead of my quick and dirty fix is I updated 
the `convertCurrentChunkToBase64AndWriteToDisk` function to do this:
   
   ```javascript
   if (cordova.platformId === 'android') {
       turnArrayBufferIntoBase64EncodedString(
           writeConvertedChunk,
           errorCallback,
           arrayBuffer.slice(startOfChunk, endOfChunk)
       );
   } else {
       writeConvertedChunk(arrayBuffer.slice(startOfChunk, endOfChunk));
   }
   ```
   
   So both platforms write the data in chunks, but on Android it's converted to 
base64 first.
   
   Thanks for bringing https://github.com/apache/cordova-js/pull/242 to my 
attention. I will have to test with a future version of Cordova and see if that 
fixes it.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to