11-08-2012 06:32 AM
I have to read top n bytes of a set of very big files in the system in my WebWorks app but I don't know how to implement it. Please help me.
Thanks
Solved! Go to Solution.
11-12-2012 05:52 PM
Hi huydq5000,
Using the FileReader you can use the function called readAsBinaryString(blob)
Suppose you had a File object named file and a FileReader object named reader.
You can use file.slice(startByte, endByte) to obtain a Blob chunk of your File object, in your case it would be something like:
reader.readAsBinaryString(file.slice(0, n));
Take a look at the "Slicing a File" section in this link:
http://www.html5rocks.com/en/tutorials/file/dndfil