const multer = require('multer');

const storage = multer.diskStorage({
    destination: (req, file, cb) => {
        cb(null, 'uploads/experienciaLaboral');
    },
    filename: (req, file, cb) => {
        const ext = file.originalname.split('.').pop();
        const random = Math.floor(Math.random() * 1000000);
        cb(null, `experiencia-${Date.now()}-${random}.${ext}`);
    }
});

module.exports = multer({ storage });
