Frage

I have a problem using the Javascript FileSystemObject trying to read huge files.

For example, I have a text file of 200mb and everytime I read this file the code stops working.

Its possible to read the text file, but for example ONLY the first 10 lines or stop reading after 10mb?

This is my code:

var fso, a, ForReading;
ForReading = 1;
fso = new ActiveXObject("Scripting.FileSystemObject");
file = fso.OpenTextFile(fileValue, ForReading, false, -2);
data = file.readAll();
form.displayedData = data;
file.Close();

What can I do here?

Thx

War es hilfreich?

Lösung

data = file.read(10 * 1024 * 1024);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top