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

259
Views
Flask send_file inline not working as expected

Generating a PDF report in Flask and sending the file to the client using:

send_file(file,as_attachement=False)

On the React JS end I have a function the handles the PDF file: Using Axios:

const receiveFile = (data) => {
    if (data.data) {
        let url = window.URL.createObjectURL(new Blob([data.data]));
        let link = document.createElement("a");
        link.href = url            
        link.setAttribute("download", data.filename)            
        document.body.appendChild(link)
        link.click()
        document.body.removeChild(link)
    }
}

The file gets sent without issue and the receiveFile received the data properly; however, my browser is set to open PDF files. Instead I am being asked to download it. How do I fix the code so the browser displays the PDF when it is received.

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!