-1

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

Mohit Agarwal
  • 201
  • 2
  • 10

1 Answers1

0

You should place that pdf file in secured location, see console log for the error: This request has been blocked; the content must be served over HTTPS.

MilosMarkoni
  • 171
  • 8