Date:  09/16/2002 08:50:05 AM Msg ID:  000882
From:  Howard Vigorita Thread:  000882
Subject:  streaming audio with foxweb
Actually this pertains to streaming any binary file.
 
Wrote a little streaming routing to read a large multi-megabyte file which was too big for FileToStr(). So read it with FREAD() a chunk at a time and streamed the output to the browser by setting Response.Buffer=.F. and using Response.Write.   Also set the content type and other header items, as appropriate.  The problem is that right clicking on the link and saving the streamed data to a file reveals data corruption, depending on the size of the chunks being streamed.  THe file sizes were always correct, however.
 
I stumbled on the fact that the problem seems to go away if you use a chunk size consisting of a power of 2 less 1, e.g., (1024*64)-1 or (1024*32)-1.  Go figure.