title: Upload bytes or base64 string to s3 ruby sdk
body: <p>I'm trying to upload an image to s3 using the ruby aws sdk. I'm able to upload the base64 string if I don't set the content_type. If I do set the content_type to <code>image/png</code> the upload is just the generic image thumbnail.  </p>
  
  <pre><code>obj = #&lt;Aws::S3::Object bucket_name="mybucket", key="test"&gt;
  
  &gt;&gt; params[:file]
  &gt;&gt; "data:image/png;base64,iVB...."
  
  obj.put(body: params[:file], content_type: 'image/png', content_encoding: 'base64')
  </code></pre>
  
  <p>How can I upload a Base64 string to s3? I'm also open to uploading as bytes if that's more straight forward </p>