I have found the following asp.net code to be very useful when serving files from a database:
Response.AppendHeader(\"content-disposition\", \"attachment; fi
Refer to RFC 6266 (Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)) http://tools.ietf.org/html/rfc6266