I am writing a JavaScript function that download 10-15 PDFs from an array of URLs. But for now lets try just one static file.
I have tried adding the file in a <a>
tag like
I tried adding this to my page, the URL shows up and it downloads on click
<a href="" download="http://www.africau.edu/images/default/sample.pdf" > download this</a>
I've also tried
<a href="http://www.africau.edu/images/default/sample.pdf" download="http://www.africau.edu/images/default/sample.pdf" > download this</a>
But it always is corrupted.
I have tried several combinations.
P.S. The files aren't on current domain, they're on another domain