This commit is contained in:
dzikafoczka 2024-12-21 22:43:48 +01:00
parent a10a900716
commit f23cc3c677

4
ec2.py
View File

@ -1,5 +1,6 @@
import boto3
from boto3.s3.transfer import S3Transfer
from boto3.s3.transfer import TransferConfig
import base64
import os
@ -271,7 +272,8 @@ def create_s3_bucket(s3_client, bucket_name):
return bucket_name
def upload_files_to_s3(s3_client, bucket_name, folder_path):
transfer = S3Transfer(s3_client)
config = TransferConfig(multipart_chunksize=50 * 1024 * 1024)
transfer = S3Transfer(s3_client, config)
for root, dirs, files in os.walk(folder_path):
for file in files:
file_path = os.path.join(root, file)