You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/10/19 18:57:29 UTC
[GitHub] [cordova-plugin-file] ataylor32 edited a comment on pull request #461: FileWriter writes data in chunks, and converts ArrayBuffers to Base64. Fixes Issue #364
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: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org