add built file
This commit is contained in:
parent
22933ad6b9
commit
b8673e6a40
1 changed files with 3 additions and 0 deletions
|
|
@ -2146,11 +2146,14 @@ app.post('/api/upload', (req, res) => {
|
||||||
log.log(err);
|
log.log(err);
|
||||||
res.status(400).send("Something went wrong!");
|
res.status(400).send("Something went wrong!");
|
||||||
}
|
}
|
||||||
|
const dim = await Images.getDimensions(`${UPLOAD_DIR}/${req.file.filename}`);
|
||||||
const imageId = db.insert('images', {
|
const imageId = db.insert('images', {
|
||||||
filename: req.file.filename,
|
filename: req.file.filename,
|
||||||
filename_original: req.file.originalname,
|
filename_original: req.file.originalname,
|
||||||
title: req.body.title || '',
|
title: req.body.title || '',
|
||||||
created: Time.timestamp(),
|
created: Time.timestamp(),
|
||||||
|
width: dim.w,
|
||||||
|
height: dim.h,
|
||||||
});
|
});
|
||||||
if (req.body.tags) {
|
if (req.body.tags) {
|
||||||
const tags = req.body.tags.split(',').filter((tag) => !!tag);
|
const tags = req.body.tags.split(',').filter((tag) => !!tag);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue