AWS S3 download file from Flask AWS S3 download file from Flask flask flask

AWS S3 download file from Flask


That is related to your AWS region. Mention the region name as an added parameter.

Try it on your local machine, using

aws s3 cp s3://bucket-name/file.png file.png --region us-east-1

If you are able to download the file using this command, then it should work fine from your API also.


The problem was that with flask I needed to declare s3_client as global variable instead of just inside the function.

Now it works perfectly!