title: Serverless framework - uploading binary files to S3 become corrupted
body: <p>I have an endpoint that takes in form data including a file. This file can be a text file, image, or pdf. I'm using busboy (v0.2.14) to parse the form data. That code looks like this:</p>
  
  <pre><code>        let buffers = [];
  
          file.on('data', data =&gt; buffers.push(data));
  
          file.on('end', () =&gt; {
              result.filename = filename;
              result.contentType = mimetype;
  
              // Concat the chunks into a Buffer
              result.file = new Buffer.concat(buffers);
          });
          // ...
          busboy.write(event.body, event.isBase64Encoded ? 'base64' : 'binary');
          busboy.end();
  </code></pre>
  
  <p>However, when I push the file data up to S3 using the AWS SDK (v2.97.0), all the binary files are corrupted when I go to view them. This does not happen to text files. The S3 upload code looks like this:</p>
  
  <pre><code>static myPutObject(bucketName, fileName, data, contentType, acl) {
      const params = {
          Bucket: bucketName,
          Key: fileName,
          Body: data,
          ACL: acl,
          ContentType: contentType,
          ContentEncoding: 'base64'
      };
  
      return new AWS.S3().putObject(params).promise();
  }
  </code></pre>
  
  <p>I've tried everything that I can find on Stack Overflow or GitHub with no luck.  </p>