skip to Main Content

I’m trying to add file(PDF) download link with HTML ‘a’ tag.

this is what I did

 <a href="../assets/document/swb-doc.pdf" download="swb_introduction.pdf"
    target="_self">INTRODUCTION</a>

when I click the link, chrome does download "swb_introduction.pdf" but it says "Failed, File doesn’t exist"

How can I fix this problem ?

2

Answers


  1. Modify the href:

     <a href="@/assets/document/swb-doc.pdf" download="swb_introduction.pdf" target="_self">INTRODUCTION</a>
    
    Login or Signup to reply.
  2. Have you tried to download the file by writing the full url into your browser instead? Does it work there?

    My guess is that either your path is wrong or that file is not accessible, due to misconfigured rights.

    It would help to add your project structure to your question.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search