Joel Henry created CB-14110:
-------------------------------
Summary: Cordova Plugin File not reading large json files
correctly - android
Key: CB-14110
URL: https://issues.apache.org/jira/browse/CB-14110
Project: Apache Cordova
Issue Type: Bug
Components: cordova-plugin-file
Affects Versions: 6.0.1
Environment: cordova version: 7.1.0
cordova-android: 7.1.0
cordova-ios: 7.1.0
Reporter: Joel Henry
When reading a large json file (293kb), readAsText renders string incorrectly,
adding duplicate text after the file's text ends and breaking json structure.
JSON.parse the text fails due to this. It hangs and fails.
{code:java}
const root = `${this.window.cordova.file.applicationDirectory}www/assets/`;
this.window.resolveLocalFileSystemURL(this.root + fileName,
(fileEntry: FileEntry) => {
fileEntry.file(file => {
const reader = new (<any>this.window.cordova).FileReader();
reader.onloadend = function () {
console.log(JSON.parse(this.result));
};
reader.readAsText(file);
});
});
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]