まず、android から node.js に画像ファイルを送信し、node.js を使用して画像ファイルを DB に保存します。
しかし、私はそれを行う方法がわかりません。
これは私のNode.jsコードです
.post('/picture', upload.single('files'), (req,res)=>{
res.json(req.file)
console.log(req.body)
console.log(req.file)
})
これは からの結果ですreq.file
:
fieldname: 'files',
originalname: 'CHOIHYOGIL.png',
encoding: '7bit',
mimetype: 'image/png',
destination: 'images/',
filename: 'c98531598c04abda7e936ef310b147e9',
path: 'images\\c98531598c04abda7e936ef310b147e9',
size: 1372912
このイメージを MySQL DB に保存したいと考えています。