Nodejs Express 4 Multer | Stop file upload if user not authorized

后端 未结 3 900
南旧
南旧 2021-02-09 01:29

I\'m using multer as multipart middelware for express4.

Express is configured to use passport as auth middelware, but I cannot find a way to prevent file up

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-09 01:43

    From the multer api doc "You can even stop a file from being uploaded - just return false from the event handler. The file won't be processed or reach the file system."

提交回复
热议问题