flask Upload file to local s3 1

flask Upload file to local s3

import boto3
session = boto3.session.Session()

s3 = session.client(
            service_name='s3',
            endpoint_url='http://localhost:4566',
        )
bucket_name = "mybucket"
s3.upload_fileobj(uploadedFile, bucket_name, file_name)

Here is what the above code is Doing:
1. Create a session object.
2. Create a client object.
3. Upload the file to the bucket.

Similar Posts