Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda