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

134
Visualizações
ReactJs Download a file from local folder

I have this code :

var link= document.createElement("a");
link.setAttribute("download",name);
link.href=uri;
link.target="_blank";
document.body.appendChild(link);
link.click();
link.remove();

Here I am passing -

url ="M:/folderfname/filename.xlsx";
name = "filename.xlsx"

I am getting this error:

Not Allowed To Load Local Resource file://M:/folderfname/filename.xlsx

I am not getting how can I resolve this in react. Or is there any alternative to download file ?

Note: this is not about downloading a single file which I can import and download. FileName to download getting generated dynamically.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It is not possible to access the local file system in your browser app without explicit permission. One of the browser's primary functions is to prevent this.

You can take a look at the File System Access API for progress in this area. Alternatively, you can operate a web server on your device and communicate with it in your app, using it as a proxy to access the file system. Because you are already writing JavaScript, I suggest that you explore Deno and Node for the server approach.

about 4 years ago · Juan Pablo Isaza Relatório
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