First of all, thanks for posting this. It works great.
However, I did have to add one extra line of code.
At the end of the while(){} statement that writes the bytes I had to add a:
context.Response.Close();

Or else after a few times of refreshing the page IIS would no longer respond, or take a very long time to do so.
So if anyone has this same problem I believe this might help.

Thanks,