Member-only story
How to upload a file to Amazon S3 in Python
For those building production applications may decide to use Amazon Web Services to host their applications and also take advantage of the many wonderful services they offer. One of these services is Amazon S3 (Simple Storage Service). This service is responsible for storage of files like images, videos, music, documents and so on. It is also important for storing static files for web applications, like CSS and JavaScript files.
In this tutorial, I will be showing how to upload files to Amazon S3 using Amazon’s SDK — Boto3.
- Get Your Access Key and Access Secret
Once you have an account with Amazon Web Services, you would need an access key and secret. This will help you to make secure REST or HTTP Query protocol requests to AWS.
a. Log in to your AWS Management Console.
b. Click on your username at the top-right of the page to open the drop-down menu.
c. Click on ‘My Security Credentials’.
d. Click on ‘Dashboard’ on the left side of the page.
e. Click on ‘Rotate your access keys’ from the ‘Security Status’ section.
f. Click on the ‘Manage user keys’ button.
g. Click on the ‘Security credentials’ tab to view your access keys.