First, I send the image file from android to node.js and I want to save the image file to the DB using node.js.
But I don't know how to do that.
This is my Node.js code
.post('/picture', upload.single('files'), (req,res)=>{
res.json(req.file)
console.log(req.body)
console.log(req.file)
})
This is the result from req.file
:
fieldname: 'files',
originalname: 'CHOIHYOGIL.png',
encoding: '7bit',
mimetype: 'image/png',
destination: 'images/',
filename: 'c98531598c04abda7e936ef310b147e9',
path: 'images\\c98531598c04abda7e936ef310b147e9',
size: 1372912
I want to save this image to my MySQL DB.