
const multer =require('multer');

const storage = multer.diskStorage({
    destination: (req, file, cb)=>{
        cb(null,'uploads/cargasFamiliares')

    },
    filename:(req,file,cb)=>{
        const ext = file.originalname.split('.').pop()
        cb(null, `${JSON.parse(req.body.cargaFamiliar).IDENTIFICACION_CARGA_FAMILIAR}.${ext}`)
    }
});

module.exports = multer({storage});