title: Multipart passthrough in API Gateway
body: <p>I have a web application that accepts multipart/form-data and have set up api gateway to pass through the requests to it. However, any time I upload images as part of the form they end up being larger than the original file I uploaded and corrupted. If I execute the same method without going via AWS API gateway the image uploads fine. Any ideas what I'm missing here?</p>
  
  <p>the below is my S3 code that reads the form data in flask:</p>
  
  <pre><code>    f = request.files['attachment']
      fp = StringIO(f.read())
      file_uuid = str(uuid.uuid4())
      bucketkey.key = "att_%s%s" % (file_uuid, file_extension(f.filename))
      bucketkey.set_contents_from_file(fp)
  </code></pre>
  
  <p>I'll attach a link to a sample jpg that is corrupted if its useful at all.</p>
  
  <p><a href="https://s3.eu-central-1.amazonaws.com/agendacommunities/att_ef7375b1-bb19-4df9-9162-5582ed66797c.jpeg" rel="nofollow noreferrer">https://s3.eu-central-1.amazonaws.com/agendacommunities/att_ef7375b1-bb19-4df9-9162-5582ed66797c.jpeg</a></p>