سؤال

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