title: Returning a PDF from S3 in Flask
body: <p>I'm trying to return a PDF in the browser in a Flask application. I'm using AWS S3 to store the files and boto3 as the SDK to interact with S3. My code so far is:</p>
  
  <pre><code>s3 = boto3.resource('s3', aws_access_key_id=settings.AWS_ACCESS_KEY,
                  aws_secret_access_key=settings.AWS_SECRET_KEY)
  file = s3.Object(settings.S3_BUCKET_NAME, 'test.pdf')).get()
  response = make_response(file)
  response.headers['Content-Type'] = 'application/pdf'
  return response
  </code></pre>
  
  <p>I'm able to successfully retrieve the object from S3 in <code>file</code> using boto3, however that is a dictionary of which I'm not sure how to return the PDF from that</p>