title: Unsupported body payload object
body: <p>I want to upload a large file using nodejs!
  I do as described in the AWS documentation
  like this:</p>
  <pre><code>var fs = require('fs');
  var zlib = require('zlib');
  
  var body = fs.createReadStream('bigfile').pipe(zlib.createGzip());
  var s3obj = new AWS.S3({params: {Bucket: 'myBucket', Key: 'myKey'}});
  s3obj.upload({Body: body}).
    on('httpUploadProgress', function(evt) {
      console.log('Progress:', evt.loaded, '/', evt.total); 
    }).
    send(function(err, data) { console.log(err, data) });
  </code></pre>
  <p>Or as shown in the aws-sdk example</p>
  <pre><code>var AWS = require('aws-sdk')
  
  var uploadParams = {Bucket: process.argv[2], Key: '', Body: ''}
  var file = process.argv[3]
  
  var fs = require('fs')
  var fileStream = fs.createReadStream(file)
  fileStream.on('error', function(err) {
    console.log('File Error', err)
  })
  
  uploadParams.Body = fileStream
  var path = require('path')
  uploadParams.Key = path.basename(file)
  
  s3.upload (uploadParams, function (err, data) {
    if (err) {
      console.log(&quot;Error&quot;, err)
    } if (data) {
      console.log(&quot;Upload Success&quot;, data.Location)
    }
  })
  </code></pre>
  <p>But anyway I get the error</p>
  <p><code>Unsupported body payload object</code></p>
  <p>I searched the entire Internet and did not find an answer, what could be the problem ((does anyone have any ideas why it does not work ??</p>