Reputation: 807
I want to express fileName = req.files.raymond.originalFilename;
But I don't know if it is "raymond" beforehand.
So, I have to substitute a variable into the expression
(req.body.key has the name I need )
const name = req.body.key;
const fileName = req.files.name.originalFilename;
But this way of substitution doesn't work. What is the correct way to do this?
Upvotes: 2
Views: 49