shkumar156 commited on
Commit
5cac14f
·
verified ·
1 Parent(s): f651031

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +7 -7
server.js CHANGED
@@ -39,13 +39,13 @@ const storage = multer.diskStorage({
39
  const upload = multer({
40
  storage: storage,
41
  fileFilter: function (req, file, cb) {
42
- // Accept only image files
43
- if (file.mimetype.startsWith('image/')) {
44
- cb(null, true);
45
- } else {
46
- cb(new Error('Only image files are allowed!'), false);
47
- }
48
- },
49
  limits: {
50
  fileSize: 10 * 1024 * 1024 // 10MB limit
51
  }
 
39
  const upload = multer({
40
  storage: storage,
41
  fileFilter: function (req, file, cb) {
42
+ // Accept image and video files
43
+ if (file.mimetype.startsWith('image/') || file.mimetype.startsWith('video/')) {
44
+ cb(null, true);
45
+ } else {
46
+ cb(new Error('Only image and video files are allowed!'), false);
47
+ }
48
+ }
49
  limits: {
50
  fileSize: 10 * 1024 * 1024 // 10MB limit
51
  }