1

I had read the following:
How to trigger a file download when clicking an html <a> tag or javascript in a modern browser
How to trigger a file download when clicking an HTML button or JavaScript

For me isn't working.
I have a link to a file https://childrensradiofoundation.org/wp-content/uploads/2020/09/2020_COVID19-_RemoteOutreach_Campaigns_English_D3.pdf and I want to download the file:

<a class="nav-link" href="https://childrensradiofoundation.org/wp-content/uploads/2020/09/2020_COVID19-_RemoteOutreach_Campaigns_English_D3.pdf" download>Download</a>

The code above open a new tab with the link and doesn't download the file.
Any suggestions with simple JavaScript if plain HTML not working?
I don't want a button (the link is in Nav Bar).

LATER EDIT: As @Lundstromski suggest bellow, there is no way to do that.

LucianDex
  • 469
  • 2
  • 12

2 Answers2

1

The link works as intended for me with a dummy file.

<a class="nav-link" href="https://file-examples-com.github.io/uploads/2017/02/file-sample_500kB.docx" download>Download</a>
Lundstromski
  • 1,197
  • 2
  • 8
  • 17
0

Its a error of that website that file does not exist! Look here this works:

    <a class="nav-link" href="https://file-examples-com.github.io/uploads/2017/02/file-sample_500kB.docx" download>Download</a>
Filip 769
  • 118
  • 1
  • 5