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

174
Views
Uploading an MP3 to S3 from the Buffer

I'm attempting to render an MP3 file on the front-end and send it to AWS S3. I can upload a given file to AWS S3 easily enough, but not from the buffer, which is where the file is generated.

The textToSpeech call in the code sample below is coming from the IBM Watson Text-to-Speech API.

Here is an example code, the app is a Next.JS app that is calling S3 via an API:

module.exports = requireAuth(async (req, res) => {
  textToSpeech
    .synthesize(synthesizeParams)
    .then(buffer => {
     
      const s3Params = {
        Bucket: 'waveforms/audioform',
        Key: 'CONTENT.mp3',
        Body: buffer,
        ContentType: 'audio/mpeg',
        ACL: 'public/read'
      }

      s3.upload(s3Params, function (s3Err, data) {
        if (s3Err) throw s3Err
        console.log(`File uploaded successfully at ${data.Location}`)
      })
    })
    .catch(err => {
      console.log('error:', err)
    })
}

The error is Error: Unsupported body payload object, so it appears that the buffer is not being accessed correctly, but I'm not sure how to extract the relevant data.

How can I pass a file from the Node buffer to S3?

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!