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

381
Views
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
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!