Possible Duplicate:
How to Download A file stored in SQL DB in Binary Format
I stored some MS word docs in SQL Server. When I wanna download them, I save them as a file on server first then user can download them, but I'm looking for a way that doesn't involve saving the file to the server filesystem...
You'll need a custom HttpHandler implementing IHttpHandler. See IHttpHandler.ProcessRequest Method in MSDN. Set the appropriate MIME-type and redirect the binary data from your database to the HttpContext's OutputStream.
An example (guessed, not tested) for a custom handler called Docs.ashx: