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

169
Visualizações
How to save/write a file from html with javascript?

I am doing an easy desktop app to crop photos, in order to do this I have a npm project with a few dependencies and an HTML file and launch the browser with the following command, chromium-browser --disable-web-security.

The problem is that when the app execute this code:

crop(event) {
        cropper.getCroppedCanvas().toBlob((blob) => {
        saveAs(new Blob([blob] ), './a.jpg');
      });

And this download automatically the file in the download folder instead of the same folder where the index file is.

Any idea about how can I set a relative path to download the file?

Thanks.

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

0

If you are just targeting chrome, there is a way. You can use Chrome's FS functionality

https://web.dev/file-system-access/

If you first load the file using this API, you will have the FileHandler object to use when you want to save

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