-1

I used the code:

<a download href="https://web.stanford.edu/group/csp/cs21/htmlcheatsheet.pdf"> Download cheetsheat</a>

but i wasn't able to make the link download the PDF. It opens the PDF instead.

The attribute is "download" but it is not working

tshimkus
  • 1,173
  • 2
  • 17
  • 24
Sam
  • 1
  • 1
  • Add more code in your question. What did you do? What did you expect? – mechnicov Feb 20 '19 at 20:32
  • 2
    Possible duplicate of [Download Link not working in html](https://stackoverflow.com/questions/20300499/download-link-not-working-in-html) – tshimkus Feb 20 '19 at 21:07
  • I think this is what you are looking for: https://stackoverflow.com/a/6794432/4038579 – mirta Feb 20 '19 at 22:08

1 Answers1

0

Set the download attribute to the filename:

<a download="htmlcheatsheet.pdf" href="https://web.stanford.edu/group/csp/cs21/htmlcheatsheet.pdf"> Download cheetsheat</a>
Jack Bashford
  • 43,180
  • 11
  • 50
  • 79