response = s3client.put_object( Body=gz_body.getvalue(), Bucket=bucket_name, Key=s3_path, ContentType='text/plain', # the original type ContentEncoding='gzip', # MUST have or browsers will error ACL='public-read' )