const upload = multer( storage: storage, limits: fileSize: 5 * 1024 * 1024 , // 5MB fileFilter: (req, file, cb) => const allowed = ['image/jpeg', 'image/png', 'application/pdf']; if (allowed.includes(file.mimetype)) cb(null, true); else cb(new Error('Invalid file type'));
[ Client Interface ] ──( Multipart Form/Stream )──> [ Web Server / API ] ──( Validation & Parsing )──> [ Cloud Storage / DB ] upload file