Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Uploading and Downloading Files

Give Feedback

There are three ways you can upload a file:

  1. From an Object instance
  2. From a Bucket instance
  3. From the client

In each case, you have to provide the Filename, which is the path of the file you want to upload. To download a file from S3 locally, you’ll follow similar steps as you did when uploading. But in this case, the Filename parameter will map to your desired local path.

Muthukumar Kusalavan on April 29, 2020

thanks a lot for the tutorial. the term Bucket() is case sensitive?

icarolinebrasil on June 27, 2020

I received an error when try to download file

>>> s3_resource.Object(first_bucket_name, first_file_name).download_file(f'/tmp/boto_test/{first_file_name}')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~/.local/lib/python3.6/site-packages/boto3/s3/inject.py", line 314, in object_download_file
ExtraArgs=ExtraArgs, Callback=Callback, Config=Config)

Become a Member to join the conversation.