Assuming you can get a Stream, FileStream or MemoryStream for instance, you can do this:
Stream file = [Some Code that Gets you a stream];
var filename = [The name of the file you want to user to download/see];
if (file != null && file.CanRead)
{
context.Response.AddHeader("Content-Disposition", "attachment; filename=\"" + filename + "\"");
context.Response.ContentType = "application/octet-stream";
context.Response.ClearContent();
file.CopyTo(context.Response.OutputStream);
}
Thats a copy and paste from some of my working code, so the content type might not be what youre looking for, but writing the stream to the response is the trick on the last line.