node.js - nodejs amazon s3 upload filee timeout -


i'm using amazon s3 photos storage & getting error "requesttimeout: socket connection server not read or written within timeout period. idle connections closed."

here code:

function(source, name, callback) {    var awsutils = this;    fs.stat(source, function(err, file_info) {      console.log(file_info);      var bodystream = fs.createreadstream(source);      var params = {          key           : name,          contentlength : file_info.size,          body          : bodystream      };      awsutils.s3bucket.putobject(params, function (err, data) {        if(err) {          console.error('awsdriverutils-unable upload: ' + err);          callback(false);        } else {          console.log('awsdriverutils-upload success:', data);          callback(true);        }      });    });  }

the upload image file small, 44.0 kb only. research, have found says "amazon s3 send error response after 20 seconds of inactivity. error indicates amazon s3 attempting read request body, no new data arrived on period of 20 seconds."
what else should fix it, likes flush() function or so?
have tried comment out contentlength in params, neither work.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -