It depends on where your problem is.
If the file is too large to load into the stream with
LoadFromFile then there is no easy answer.
If the problem is simply that your Response buffer is too small, then it's fixable.
objStream.Read can take one argument: The number of bytes to read. So you can do this in chunks.
EXAMPLE ONLY:
In place of
Code:
Response.BinaryWrite objStream.Read
you could try doing:
Code:
CONST CHUNK = 100000 ' experiment to get best chunk size
byteCount = objStream.Size
Do While byteCount > CHUNK
Response.BinaryWrite objStream.Read(CHUNK)
Response.Flush
byteCount = byteCount - CHUNK
Loop
Response.BinaryWrite objStream.Read(byteCount)
This is untested code. I remember doing something like this almost 10 years ago, so I'm really dredging this out of vary old human memory. (Both the human and the memory are old.)