1

I'm trying to the get a hyperlink to produce a download of a .pdf file when clicked, but instead the pdf is opened directly in the browser.

I've tried moving the pdf from the root folder (that shared with the index) to a subfolder to no avail. I've found other examples of this problem on this site where they seemed to have mis-entered the attribute, but I can't see where I made my mistake if I did.

<a href="factfile.pdf" download="factfile.pdf">Download factfile (pdf, 4mb)</a> which contains lots more information, including an FAQ.</p>

1 Answers1

1

It is because Google Chrome is automatically set to open pdf automatically rather than download.

To fix this issue go to 3 dots Options > Privacy & Security > Site Settings > Additional Content Settings > PDF Documents. There you will find "Download PDF files instead of automatically opening them in Chrome". Click on the button ( I don't know what it is in english sorry ) and you will fix the issue.

  • 1
    I assume that you are using Google Chrome by the way. If it is Firefox, there is probably a similar but not same fix. – fatihbarca Apr 24 '21 at 20:06
  • 1
    I tried this fix but the problem is that instead of opening up the pdf as a page it turns all pdf links into downloads...if you get what I mean – Cecil Mahumane Apr 24 '21 at 20:48
  • 1
    Aren't you trying to make a download? As I know currently there is no just specific pdf downloading permission for a page. So, for downloading I suppose this is only fix. – fatihbarca Apr 25 '21 at 07:30