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

251
Views
Cargar archivo Hapi.js a S3

Tengo problemas para cargar un archivo en Amazon S3 usando node.js (hapi). Aquí está el código de mi ruta:

 { method: 'POST', path: '/upload', config: { auth: { mode: 'optional', }, payload:{ maxBytes: 209715200, output:'stream', parse: true }, handler: function(request, reply) { var filePath = path.join(__dirname, request.payload.file.hapi.filename); fs.readFile(filePath, function(err, data) { console.log(data); const s3 = new AWS.S3(); s3.putObject({ Bucket: 'mybucket', Key: request.payload.file.hapi.filename, Body: data, ACL: 'public-read' }, function (err) { if (err) { throw err; } }); }); reply(request.payload.file); } } }

¿Qué ocurre? Mis archivos se cargan en el clúster S3, pero con un tamaño de 0 bytes. ¿Qué hice mal? Console.log para retornos de datos <Buffer >

no sé por qué ¿Alguien puede decirme cómo solucionarlo?

over 4 years ago · Santiago Trujillo
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!