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

311
Views
Archivo de transmisión desde S3 usando express, error NoSuchKey después de que el archivo ya se cargó en el navegador

Estoy intentando transmitir imágenes y videos desde mi depósito S3 a mi navegador canalizando la transmisión a través de Express. Tengo la transmisión funcionando, pero aunque funciona en el navegador, sigo recibiendo errores de NoSuchKey cada vez que hago la solicitud.

 app.get("/:key", async (req, res) => { s3.getObject({Bucket: "my-bucket", Key: req.params.key}, (err, data) => { if (err){ console.log("error: ", err) } else { console.log("data: ", data) res.set('Content-Type', data.ContentType) res.set('Content-Length', data.ContentLength) res.status(200) let rs = require('stream').Readable.from(data.Body) rs.pipe(res) } }) // try { // s3.getObject({Bucket: "my-bucket", Key: req.params.key}).promise().then( // (data) => { // console.log("data: ", data) // res.set('Content-Type', data.ContentType) // res.set('Content-Length', data.ContentLength) // res.status(200) // let rs = require('stream').Readable.from(data.Body) // rs.pipe(res) // }, // (err) => { // console.log("error: ", err) // } // ) // } // catch(err){ // console.log(err) // } })

Intenté usar promesas con el código comentado con el mismo resultado.

producción:

 error: NoSuchKey: The specified key does not exist. at Request.extractError (C:\my_path\node_modules\aws-sdk\lib\services\s3.js:710:35) ...
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!