Storing images in the database is bad practice, as it consumes more resources of your database. Rather, you should try storing images on disk and store the path in the table.
Try something like this:
app.post('/upload'),function(req,res){
req.form.complete(function(err,fields,files){
async.series([
function(cb){
fs.rename(files.image.path+files.image.name,'./public/image/'+files.image.name,function(err){
connection.query('INSERT INTO RestaurantGalleryImages (Images,RestName) VALUES (?,?)', [fields.name,files.image.path+'/'+files.filename],
function(err){
cb();
});
});
);
});
});
You'd then POST to /Name, for example http://127.0.0.1/Name
.
Ex.
<form name='form' action='/Name' method='post'>
<input type='text' name='name'>
<input type='file' name='image'>
</form