Hi, I use multer to upload file and I want to attach other parameter in request In postman like this

my code

So I can't get req.body.test_body , How do I fix this??
I don't see req.body.test_body referred to anywhere in your code? How is it not working?
also, please post the code using fenced code blocks, that way others can copy and search the code. Like so:
``````
Write code here
``````
I just use
console.log(req.body);
So I see is {}
Your code screenshot doesn't show how it's all called so this is impossible for me to debug. Could you provide a minimum erring test case?
if your file input element is in the top of form then every data below that gets assigned to req.body after your image is uploaded, in the result of which body remains empty while you upload photo.. So take file input element to very bottom of your form so that req.body will have data from other input elements
What solved it for me was making sure the "Content-Type" header information in postman was not set; it had been set to "application/x-www-form-urlencoded" and removing allowed me to receive the file on my backend server as well as the req.body values.
I have solved and I will close this issues. sorry for last reply
Most helpful comment
What solved it for me was making sure the "Content-Type" header information in postman was not set; it had been set to "application/x-www-form-urlencoded" and removing allowed me to receive the file on my backend server as well as the req.body values.