title: How to create a file download button? <a href> and Axios not working
body: <p>I'm trying to create a download button on my personal website for people to download my docx resume, but had some issues.</p>
  
  <p>first i did it with simple href link thingy like </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;a href="xxx.docx" download&gt;&lt;button&gt;download my resume&lt;/button&gt;&lt;/a&gt;
  </code></pre>
  
  <p>but didn't work. </p>
  
  <p>then i tried axois way, creating a button with the click action bind to the downloadFile(){} method, didn't work, coming with the error</p>
  
  <blockquote>
    <p>GET <code>http://localhost:8080/assets/assets/imgs/cv_eudora.docx</code> 404 (Not Found)</p>
  
  <pre><code>Uncaught (in promise) Error: Request failed with status code 404
      at createError (createError.js?2d83:16)
      at settle (settle.js?467f:17)
      at XMLHttpRequest.handleLoad (xhr.js?b50d:59)
  </code></pre>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/Ix3AL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ix3AL.png" alt="screenshot"></a></p>
  
  <p>I think it's because the url part in the downloadFile(){} function that's not stated properly, but don't know the right way to write the path in vue. The path itself should be right because it even had the automatic hint options all the way when i did it. </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;button @click="downloadFile()"&gt;download my resume&lt;/button&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>downloadFile() {
        axios({
          url: "../assets/imgs/cv_eudora.docx",
          method: "GET",
          responseType: "blob" // important
        }).then(response =&gt; {
          const url = window.URL.createObjectURL(new Blob([response.data]));
          const link = document.createElement("a");
          link.href = url;
          link.setAttribute("download", "eudoraCV.docx"); //or any other extension
          document.body.appendChild(link);
          link.click();
        });
      }
  </code></pre>