[Vuejs]-Getting req.body and req.file as empty when uploading file with axios

0👍

Had a similar problem trying to send a text/csv file, fixed by parsing the content type before the route.
Like this:

app.use(bodyParser.raw({type: multipart/form-data}));

Before

app.use(multer({}))

bodyParser.raw([options]) returns middleware that parses all bodies as a Buffer and only looks at requests where the Content-Type header matches the type option

Leave a comment