You can do it by using the header() function
especially with the "Content-Type" HTTP
parameter
Look the PHP manual here :
http://www.php.net/manual/en/function.header.php
Small extract :
If you want the user to be prompted to save the data you are sending, such as a generated PDF file, you can use the Content-Disposition header to supply a recommended filename and force the browser to display the save dialog.
<?php
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=downloaded.pdf");
/ ... output pdf file ... /
?>