Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

107
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda