mirror of
https://github.com/requarks/wiki.git
synced 2025-02-25 18:55:30 -06:00
fix: Overwriting assert with the same name
This commit is contained in:
parent
cf7abeaa94
commit
192a28c6ed
@ -76,7 +76,8 @@ router.post('/u', (req, res, next) => {
|
||||
}
|
||||
|
||||
// Sanitize filename
|
||||
fileMeta.originalname = sanitize(fileMeta.originalname.toLowerCase().replace(/[\s,;#]+/g, '_'))
|
||||
let time = new Date().getTime()
|
||||
fileMeta.originalname = req.user.name + "_" + time + "_" + sanitize(fileMeta.originalname.toLowerCase().replace(/[\s,;#]+/g, '_'))
|
||||
|
||||
// Check if user can upload at path
|
||||
const assetPath = (folderId) ? hierarchy.map(h => h.slug).join('/') + `/${fileMeta.originalname}` : fileMeta.originalname
|
||||
|
Loading…
Reference in New Issue
Block a user