You could use the HTML5 download attribute like so:
<a href="https://stackoverflow.com/questions/11353425/path/to/file" download>Click here to download</a>
This opens a “save as” dialog regardless of file type without taking you away from the page.