add file uploads
This commit is contained in:
parent
93027bfd09
commit
2c480909ee
6 changed files with 42 additions and 7 deletions
|
@ -23,7 +23,11 @@ router.post('/', async (req, res, next) => {
|
|||
return;
|
||||
}
|
||||
|
||||
let token = randomBytes(12).toString('hex');
|
||||
let token = randomBytes(8).toString('hex');
|
||||
|
||||
if (req.file && req.file.path) {
|
||||
post += `\nfile::${req.file.path}`;
|
||||
}
|
||||
|
||||
await db.run('INSERT INTO comment (username, date, content, id) VALUES (?,?,?,?)', [
|
||||
username,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue