Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!