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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -