multer s3 - var upload = this.s3.upload(params) TypeError: this.s3.upload is not a function -


i trying upload file s3 using multer s3.however, fails. 

aws.config.update({ secretaccesskey: 'key', accesskeyid: 'secret', });

var s3 = new aws.s3()  var upload = multer({   storage: multers3({     s3: s3,     bucket: 'pdsfiles',     metadata: function (req, file, cb) {       cb(null, {fieldname: file.fieldname});     },     key: function (req, file, cb) {       cb(null, date.now().tostring())     }   }) }) 

this error looks like:

typeerror: this.s3.upload not function @ s3storage. (/home/simran/downloads/node-backend/node_modules/multer-s3/index.js:172:26) @ /home/simran/downloads/node-backend/node_modules/multer-s3/index.js:58:10 @ s3storage.getcontenttype (/home/simran/downloads/node-backend/node_modules/multer-s3/index.js:8:5) @ /home/simran/downloads/node-backend/node_modules/multer-s3/index.js:55:13 @ end (/home/simran/downloads/node-backend/node_modules/run-parallel/index.js:16:15) @ _combinedtickcallback (internal/process/next_tick.js:73:7) @ process._tickdomaincallback (internal/process/next_tick.js:128:9) 

call:

router.put('/updatepatterngrading/:pattern_number', upload.any(), function(req, res){      console.log("request obj after manipulation", req.files);      callapi(req, res, fn.bind(apiobj, 'updatepatterngrading'));  }) 

why ?


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -