Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

272
Views
Vue download docx file corrupt or not found

I'm trying to add a button or a tag to allow the user to download a .docx file that I have saved in the project. I've done this is vanilla JS and it works fine to just have an <a href="path" download>. But this isn't working in Vue.

I've also tried to do this in JavaScript instead where the user clicks a button which runs the following function:

    downloadResume() {
      const link = document.createElement("a");
      link.href = "../#/assets/Resume.docx";
      link.setAttribute("download", "Resume.docx");
      document.body.appendChild(link);
      link.click();
    }

For the link.href line, I originally did not add the # extension on it, but it would always say there's no file when it downloads. The # is part of the domain URL. It "downloads" now with it but when I try to open the file, it throws some errors saying that it's unable to read the file.

I haven't been able to find anything on this particular scenario. Everything I find on the internet is for downloading something from an external URL using Axios, converting to a blob, then downloading.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!