mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 11:39:36 +02:00
Added support for custom SVG icons
This commit is contained in:
parent
a01661d0d5
commit
1699146f79
14 changed files with 356 additions and 270 deletions
|
@ -12,9 +12,9 @@ const storage = multer.diskStorage({
|
|||
filename: (req, file, cb) => {
|
||||
cb(null, Date.now() + '--' + file.originalname);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
const supportedTypes = ['jpg', 'jpeg', 'png'];
|
||||
const supportedTypes = ['jpg', 'jpeg', 'png', 'svg', 'svg+xml'];
|
||||
|
||||
const fileFilter = (req, file, cb) => {
|
||||
if (supportedTypes.includes(file.mimetype.split('/')[1])) {
|
||||
|
@ -22,8 +22,8 @@ const fileFilter = (req, file, cb) => {
|
|||
} else {
|
||||
cb(null, false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const upload = multer({ storage, fileFilter });
|
||||
|
||||
module.exports = upload.single('icon');
|
||||
module.exports = upload.single('icon');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue