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

174
Views
How to download svg file png file from javascript server?

I want to save the svg file provided by the server as a png file with JavaScript. I think the file format is wrong, how can I download it?

This is the code to download the svg file. I wonder how to fix it.

const accessCookie = getAccessTokenCookie();
            axios({
                url: `${baseUrl}/${this.Qrid}`,
                method: 'GET',
                // responseType: 'arraybuffer',
                headers: {
                    Authorization: `Bearer` + accessCookie,
                },
            }).then(response => {
                var file = new Blob([response.data], { type: 'image/svg' });
                const fileURL = URL.createObjectURL(file);
                const link = document.createElement('a');
                link.href = fileURL;
                link.download = 'qr' + this.$date().format('YYYY.MM.DD_h_m_s') + '.svg';
                link.click();
                console.log(response);
            });
about 4 years ago · Juan Pablo Isaza
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!