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

282
Views
express js multer upload.single no funciona

Multer estaba cargando archivos correctamente, pero de repente el mismo código no obtiene el objeto de archivo en la solicitud. Es como si multer estuviera siendo ignorado por completo. Al verificar el archivo en la solicitud, req.file no está definido.

 function multerStore() { return multer.diskStorage({ destination: function (req, file, cb) { console.log(req); execHomeDir().then(resp => { const nameo = resp.replace("\n", ""); const folderPath = nameo + attachmentTemp; createFolder(folderPath).then(resp=>{ cb(null, folderPath); }).catch(ree=>{ cb(null, folderPath); }); }).catch(ree => { console.error('Error Multer'); console.error(ree); const nameo = ree.replace("\n", ""); const folderPath = nameo + attachmentTemp; createFolder(folderPath).then(resp=>{ cb(null, folderPath); }).catch(ree=>{ cb(null, folderPath); }); }); }, filename: function (req, file, cb) { console.log(req); console.log('Incoming file'+file.filename); const name = setFileName('mexuser') + file.originalname; cb(null, name); } });} function multerOps() { return multer({ storage: multerStore(), limits: fileLimiter });}const attachOps = multerOps('attachment', attachmentTemp);fileRouter.post('/:type', attachOps.single('attachment'),files.upload);
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!