I have found the following asp.net code to be very useful when serving files from a database:
Response.AppendHeader(\"content-disposition\", \"attachment; fi
Well, it seems that the Content-Disposition header was originally created for e-mail, not the web. (Link to relevant RFC.)
I'm guessing that web browsers may respond to
Response.AppendHeader("content-disposition", "inline; filename=" + fileName);
when saving, but I'm not sure.