title: upload zip and rar file using node.js and multer to cloudinary
body: <p>i'm traying to upload rar and zip file using multer to cloudinary , i upload pdf it works fine, but i want to allow only zip and rar.</p>
  
  <p>here is my code:</p>
  
  <pre><code>    var storage = multer.diskStorage({
    filename: function(req, file, callback) {
      callback(null, curDate + file.originalname);
    }
  });
  
  var DocFilter = function (req, file, cb) {
      // accept image files only
      if (!file.originalname.match(/\.(pdf||doc|docx)$/i)) {
          return cb(new Error('Only document files are allowed!'), false);
      }
      cb(null, true);
  };
  var upload = multer({ storage: storage, fileFilter: DocFilter})
  </code></pre>
  
  <p>i tryed switching to this <code>file.originalname.match(/\.(/|zip|rar)$/i</code> 
  but it did not work</p>
  
  <p>and here is the route:</p>
  
  <pre><code>router.post("/requestsList" , middleware.isLoggedIn ,  upload.single("attach") , function(req , res){
  cloudinary.uploader.upload(req.file.path, function(result) {
      var Name = req.body.name ;
      var Gender = req.body.gender ;
      var Email = req.body.email ;
      var PNumber = req.body.phone ;
      var attach = result.secure_url;
  
  var newRequest = {Name: Name , Gender: Gender , Email: Email , PhonenNumber: PNumber , Attachment: attach} ;
  Request.create(newRequest , function(err , newlyCreated){
     if(err){
         console.log(err);
         req.flash("error" , err.message);
         res.redirect("back");
     } else{
         console.log(newlyCreated);
         req.flash("success" , "Request Successfully Sent");
         res.redirect("/home") ;
     }
  });
  });
  </code></pre>
  
  <p>});</p>