express-validator giving undefined value when form set to enctype='multipart/form-data' express-validator giving undefined value when form set to enctype='multipart/form-data' express express

express-validator giving undefined value when form set to enctype='multipart/form-data'


Your use of 'multipart/form-data' prevents Express from parsing the values of the other form fields. The easiest way to get around this is to use a middleware that parses multipart forms, and gives you access to both fields and image/s.

There are several such middleware packages, each with its own support/documentation/track record: multer, busboy, multiparty etc. I've used multiparty in several projects in the past, with no issues, but there are newer packages.