Skip to content

Instantly share code, notes, and snippets.

@djouallah
Created October 10, 2024 23:15
Show Gist options
  • Save djouallah/6d8200dd9c69dadf47daadd8ec6c348f to your computer and use it in GitHub Desktop.
Save djouallah/6d8200dd9c69dadf47daadd8ec6c348f to your computer and use it in GitHub Desktop.
import boto3
s3_resource = boto3.resource('s3',
region_name = "us-east-1" ,
endpoint_url = "zzzzzzzzzzzzzzzzzzzz" ,
aws_access_key_id = "uuuuuuuuuuuuuuuuuu",
aws_secret_access_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
bucket_name = "uuuuu"
bucket = s3_resource.Bucket(bucketName)
for file in files_to_upload:
print('upload to R2 '+file)
bucket.upload_file(file, file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment