copy paste support
This commit is contained in:
parent
adeda1b0f5
commit
3bd9d47a3c
4 changed files with 27 additions and 3 deletions
|
@ -75,12 +75,15 @@ router.get('/', function (req, res, next) {
|
|||
|
||||
router.post('/', upload.array('fileupload'), function(req, res, next) {
|
||||
if (!req.files || Object.keys(req.files).length === 0) {
|
||||
console.log(req)
|
||||
return res.status(400).send('No files were uploaded.');
|
||||
}
|
||||
|
||||
for (file in req.files) {
|
||||
db.run('INSERT INTO media (path) VALUES (?)', [req.files[file].filename], function (err) {
|
||||
if (err) return next(err);
|
||||
if (err) { console.log(err)
|
||||
return next(err);
|
||||
}
|
||||
return res.redirect('/');
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue