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);