See the Content-Disposition (RFC-2616) HTTP header, and use the value attachment
(as opposed to the default value; inline
):
If this header is used in a response [...] the user agent should not display the response, but directly enter a `save response as...' dialog.
Example:
Content-Disposition: attachment; filename="filename.tif"
See also Content-Disposition (MDN):
The first parameter in the HTTP context is either inline
(default value, indicating it can be displayed inside the Web page, or as the Web page) or attachment
(indicating it should be downloaded; most browsers presenting a 'Save as' dialog, prefilled with the value of the filename parameters if present).