ssamuel68
ssamuel68

Reputation: 952

Using Javascript FileSystemObject with huge files

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

Upvotes: 1

Views: 285

Answers (1)

Esailija
Esailija

Reputation: 140234

data = file.read(10 * 1024 * 1024);

Upvotes: 1

Related Questions