Express - How to validate file input with express-validator?
<p>I am using express-validator for validation. In my controller I have a method for adding new pictures to the database. Here is my code:</p>

<pre><code>function createPicture(req, res) {

req.checkBody('title', `The title can't be empty.`).notEmpty();
req.checkBody('image', 'You must select an image.').notEmpty();

let errors = req.validationErrors();

if (errors) {
    res.json({errors: errors});
} else { ... }
</code></pre>

<p>The code works for the title field however no matter if I select an image or not - I still get a validation error about it. How can I validate file input? I just want it to be required.</p>