angularjs - streaming-s3 is not working on live -Nodejs -
i using streaming-s3 node-modules, working fine on local machine.
but on live doesn't seem working. have https enabled on live server.
if disabled https on live server uploading working fine .
here code
exports.uploadfile = function (filereadstream, awsheader, cb) { //set options streaming module var options = { concurrentparts: 2, waittime: 20000, retries: 2, maxpartsize: 10 * 1024 * 1024 }; //call stream function upload file s3 var uploader = new streamings3(filereadstream, config.aws.accesskey, config.aws.secretkey, awsheader, options); //start uploading uploader.begin();// important if callback not provided. // handle these functions uploader.on('data', function (bytesread) { console.log(bytesread, ' bytes read.'); }); uploader.on('part', function (number) { console.log('part ', number, ' uploaded.'); }); // parts uploaded, upload not yet acknowledged. uploader.on('uploaded', function (stats) { console.log('upload stats: ', stats); }); uploader.on('finished', function (response, stats) { console.log(response); logger.log('info', "upload ", response); cb(null, response); }); uploader.on('error', function (err) { console.log('upload error: ', err); logger.log('error', "upload error: ", err); cb(err); });
any idea
thanks
you need enable ssl in client, add sslenabled
option following
var options = { sslenabled: true, concurrentparts: 2, waittime: 20000, retries: 2, maxpartsize: 10 * 1024 * 1024 };
you can check more options can use http://docs.aws.amazon.com/awsjavascriptsdk/latest/aws/config.html
Comments
Post a Comment