Take the 2-minute tour ×

The following codes work, but instead of oStream.Read which reads all bytes at once, I want to read it in chunks...what is the api for it? I see there is something "oStream.Read 256" that allows you to read the first 256 bytes, but that is not what I need...

say the file is 1,000,000 bytes, I want to read it 256 bytes at a time... 0-255, 256-511 so on...

oStream = new ActiveXObject("ADODB.Stream");
oStream.Type = adTypeBinary;
content = oStream.Read;

thank you

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I have just made a test script using your code and as long as I define adTypeBinary as 1, substitute oItem.path for a known filename and use oStream.Read(256), it works as you require. Check to see it you aren't accidentally reloading the file or rewinding the stream. If all else fails, the Position property should be able to set the next read position for you.

share|improve this answer

Your Answer


