How to set different destinations in nodejs using multer?

后端 未结 5 1854
你的背包
你的背包 2021-01-31 22:11

I\'m trying to upload any file using Multer package. It\'s working fine when I use following code in my server.js file.

var express         


        
5条回答
  •  日久生厌
    2021-01-31 22:40

    Multer is a middleware so you can pass it like this :

    app.post('/test/route', multer({...options...}), module.someThing)
    

    or

    app.post('/test/route', multer({...options...}), function(req, res){
    ........some code ......
    });
    

提交回复
热议问题