Lukas Walther Haagh
Lukas Walther Haagh
We were running into some of the same issues. We try to download files via XMLHttpRequest, and write the contents via a fileWriter. Writing files larger than a few megabytes...
I have managed to change FileWriter, such that it can convert ArrayBuffers to base64 encoded strings itself. To get the correct base64 encoded string, it is important to call `FileReader.readAsDataURL`...
I have implemented the chunking behaviour in [FileWriter.js](https://github.com/LightMind/cordova-plugin-file/blob/master/www/FileWriter.js). It seems pretty necessary to do chunking, because even though we skips the `args[i] = base64.fromArrayBuffer(args[i]);` part, cordova.js still calls `JSON.encode` on...
@raphinesse Thank you so much, I really appreciate it :) I am also a little bit worried about changing the behaviour of `FileWriter` to always use chunks, because it can...
See my comment here, for an explanation why FileWriter.write can crash your app: https://github.com/apache/cordova-plugin-file/issues/364#issuecomment-773977157
The failing tests do not seem to be related to my changes at all :/
@pietos I am happy that these changes helped you, thanks for checking it out :) Sorry that I have not been active on this issue. I think it's stable enough...
Hi @ataylor32 , thank you for looking into this 👍 The original problem was, that the bridge between JS and the Android Native part doesn't support passing binary data. The...
@ataylor32 Thanks for the example app, I will use it for testing :) > So I switched to the code from https://github.com/LightMind/cordova-plugin-file/blob/master/www/FileWriter.js , Do you mean you switched to the...
@ataylor32 please have a look at this merge request for cordova.js, it looks like they are improving the conversion to base64 on their side, which might make this issue obsolete...