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

111
Views
Koa Multer no funciona con puntos finales POST solo GET

Estoy tratando de cargar un archivo usando @koa/multer y js de acuerdo con la documentación de la biblioteca, pero solo funciona en los puntos finales GET y si intento replicar lo mismo en los puntos POST, la propiedad del archivo no está definida. ¿Alguien sabe cómo arreglarlo?

ENRUTADOR.js

 import Router from 'koa-router'; import Multer from '@koa/multer'; const router = new Router(); const upload = multer(); router.post('/test', upload.single('csv'), Controller.test) //if change to GET works fine!! module.exports = router;

CONTROLADOR.js

 async test(ctx) { console.log(ctx.request.file); //undefined console.log(ctx.file); //undefined console.log(ctx.request.body); //undefined ctx.response.status = 204; }

si el enrutador obtiene el retorno de console.logs

 { fieldname: 'csv', originalname: 'namefile.csv', encoding: '7bit', mimetype: 'text/csv', buffer: <Buffer 41 63 63 65 73 43 55 4d 51 45 53 4b 53 47 51 4b 45 ... 46 more bytes>, size: 96 }
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!