简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM