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

176
Vistas
how to send data on file with sendFile in express

I am trying to parse my csv file in server and return back the information after parsing and analyzing the data in csv.

I am not that used to express and i dont know any view engine.

I plan to use

res.sendFile(path.join(__dirname, "/index.html"));

to host my index file.

What are the other way than ajax and view template that can I send data to the index.html with sendFile.

I am sending JSON files from server to client

Any kind of help is appreciated !!!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

When a client (such as a browser) makes a request you can respond with one thing.

You can respond with:

  • The contents of a file as you are now (although you should use the static middleware instead of rolling your own end point handlers (without caching) one-by-one)
  • A template + some data rendered into a single file (using the view engines you haven't gotten around to learning yet)
  • Some JSON (typically in response to an Ajax request so the a JS program running in an HTML document get add more data to the existing HTML page)
  • Something else

If sending an unmodified file is not what you want, then don't use sendFile.

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