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

379
Vistas
Send a file from NodeJS socketio server to Python socketio client

I have a Frontend application sending file over HTTP to Nodejs Backend. The Nodejs application acts as a socketio server and needs to send the file to a python socketio client. I have used multer to parse the HTTP request. Here are the nodejs and python code I have written so far (only pasted required parts)

// NodeJS server code I have written so far (could be completely wrong)

// req.file contains the file parsed from multer
    var socket = req.app.get('socket');
    let readStream = createReadStream(req.file.path);
    readStream.on('ready', () => {
        socket.emit('image', readStream, data => console.log(data));
        readStream.pipe(createWriteStream(req.file.originalname));
    });
# Python socketio client
@sio.event
async def image(data):
    try:
        print(data)
        # want to save data preferably in a local file or a buffer is also fine
    except:
        return 'NOT OK'
    finally:
        return 'OK'

I am facing issues on both fronts, for both of which I have almost no idea how to procede:

  • sending image from nodejs (thought of using fs.createReadStream but don't know how to use the stream over a socketio event)
  • receiving image on python and storing it locally.
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