Skip to content
Advertisement

Multer – Cannot read property ‘buffer’ of undefined

I have a problem uploading an image file to my server, I watched some tutorials on YouTube about multer and I do exactly the same thing that is done in the tutorial and for whatever reason, I get an error: (“Cannot read property ‘buffer’ of undefined”), and req.file is also undefined. I googled for the error and found some people having the same issue and I tried to solve it like them, but it didn’t work for me.

COMPONENT Data App

JavaScript

COMPONENT ImageParse

JavaScript

COMPONENT Route

JavaScript

COMPONENT Logic api

JavaScript

Advertisement

Answer

it is not req.buffer

it is req.file.buffer

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement