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

256
Vistas
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
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