質問

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

役に立ちましたか?

解決

data = file.read(10 * 1024 * 1024);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top