I have a problem using Javascript FileRead while trying to read huge files.
For example, I have a 200 MB text file, and every time I read this file, the code stops working.
Is it possible to read a text file, but, for example, ONLY the first 10 lines or stop reading after 10mb?
This is my code:
var file = form.getEl().down('input[type=file]').dom.files[0]; var reader = new FileReader(); reader.onload = (function(theFile) { return function(e) { data = e.target.result; form.displayedData=data; }; })(file); reader.readAsText(file);
e.target.result always contains all the data in the file.
What can i do here?
thanks
javascript filereader onload
ssamuel68
source share