2👍
✅
You can use boto3
to upload files to s3.
import boto3
client = boto3.client('s3')
# For more client configuration http://boto3.readthedocs.io/en/latest/
def upload_s3(files):
for f in files:
print(f)
response = client.put_object(
Body= f,
Bucket=<bucket_name>,
Key=<location/directory>
)
# More code here
Source:stackexchange.com