title: Most efficient way to upload image to Amazon S3 with Python using Boto3
body: <p>I'm implementing Boto3 to upload files to S3, and all works fine. The process that I'm doing is the following:</p>
  
  <p>I get base64 image from FileReader Javascript object. Then I send the base64 by ajax to the server, I decode the base64 image and I generate a random name to rename the <code>key</code> argument </p>
  
  <pre><code>data = json.loads(message['text'])
  dec = base64.b64decode(data['image'])
  s3 = boto3.resource('s3')
  s3.Bucket('bucket_name').put_object(Key='random_generated_name.png', Body=dec,ContentType='image/png',ACL='public-read')
  </code></pre>
  
  <p>This works fine but respect to performance, is there a better way to improve it?</p>