mirror of
https://github.com/pawelmalak/flame.git
synced 2026-02-28 01:13:11 +08:00
Added support for custom SVG icons
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user