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

111
Visualizações
Json File Opening in New Tab instead of Downloading

I'm using Angular and TypeScript to send some files to the user using googleapis storage service. Whenever I send a geojson file to download, instead of downloading it to the computer, it just opens the file in a new tab without downloading it. I'm creating the file in the backend server, saving it to the google service, and then sending the download url to the user. When I use this function to download KML files, it downloads just fine, but when I try to download geojson it just opens it as plain text in a new tab. How can I make it download as a normal file?

const download_url = res.download_url;
saveAs(download_url, 'sample2.kml');
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Use this function:

downloadFile(data: Response) {
  const blob = new Blob([data], { type: 'text/csv' });
  const url = window.URL.createObjectURL(blob);
  window.open(url);
}
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