I have a problem where Google Chrome automatically opens pdf files instead of downloading them.
I need to be able to force this download with js so that the script then accesses another page.
I have a problem where Google Chrome automatically opens pdf files instead of downloading them.
I need to be able to force this download with js so that the script then accesses another page.
This is a simple html5 solution:
<a href="https://where.you.hosted/your.pdf" download="filename.pdf" target="_blank">Download</a>
Note that IE still doesn't support this. But should be enough if you just want to support modern browsers.