Sometimes you can change the http headers:
header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=\"lol.pdf\"");
Same. But some browsers actually prevent this for security reasons.
Edit
Since I realized that this is not clear. These headers will be sent from another page that is actually read in the file and sends it to the browser with these headers.
The link then points to the href attribute on this PHP page, which reads in the file and sends the headers.
source share