-1

I'm trying put on my page download link, where I can download pdf file. I'm using this block below but when I'm trying download file it's failure. How can I fix this problem?

<div>
       <a href="http://www.mypage.com/documents" download="name_of_file.pdf" class=" btn btn-lg btn-outline">Download CV english version </a>
    </div>
kenzolek
  • 344
  • 6
  • 24
  • 1
    What does "it's ending failure" mean specifically? – j08691 Jan 11 '16 at 16:14
  • I cannot download file – kenzolek Jan 11 '16 at 16:14
  • 3
    Well for starters, your link points to a folder, not a PDF file. – j08691 Jan 11 '16 at 16:15
  • Pdf file is inside folder that's name is "documents". I thought the solve my problem is create path: http://www.mywebsite.com/documents/name_of_file.pdf but it is not working too. I cannot download file when I put my website to server. – kenzolek Jan 11 '16 at 17:21
  • Does the file actually exist at that path? Can you load the file at that path without the download attribute? – j08691 Jan 11 '16 at 17:47

1 Answers1

0

http://www.mypage.com/documents is a folder, not a file. Try changing the href to a file

Example:

<div>
   <a href="http://www.mypage.com/documents/your_specific_file.jpg" class=" btn btn-lg btn-outline">Download CV english version </a>
</div>

You can change the name of your file with the download property. For example if you add download="New_name.jpg" the file will be downloaded as New_name.jpg and not your_specific_file.jpg

Emil Nik
  • 29
  • 5