Forum Discussion
read = new FileReader(); the part i'm having troubles with
//read.readAsText(fileObject);
read.onload = function(){read.readAsText(fileObject);} ***
var fileContents= read.results;
- angela5 years agoCatalyst II
This is a variant that I previously used, also I used a native JS filepicker and not the inbuild one from Aras (my fileObject is slightly different).
var reader = new FileReader();
if (reader.readAsBinaryString) {
reader.onload = function (e) {
ProcessFile(e.target.result);
};
reader.readAsBinaryString(fileUpload.files[0]);
}I right now work on an alternative BatchLoader that can upload XLS, XLSX, CSV and TXT. It shall mainly be used for BOM import, but I also want to use it for all kind of imports for Aras instances without subscription.
I search for people that want to join in the project. My current draft works and imports already. It can be flexible used for various kind of import and even contains a preview of the data. But it´s not performance optimized yet and validation before import is missing. If you or anyone else in community is interested in active (!) collaboration, you would be welcomed to join the project!
- lucas5 years agoCreator II
thanks for your help.
var read = new FileReader();
read.readAsText(fileObject);
//read.onload = function(){read.readAsText(fileObject);}
//var fileContents= read.results;
read.onload = readerEvent =>
{this fixed my problem. if anyone have the same problem.