test
This commit is contained in:
parent
a10a900716
commit
f23cc3c677
4
ec2.py
4
ec2.py
@ -1,5 +1,6 @@
|
|||||||
import boto3
|
import boto3
|
||||||
from boto3.s3.transfer import S3Transfer
|
from boto3.s3.transfer import S3Transfer
|
||||||
|
from boto3.s3.transfer import TransferConfig
|
||||||
import base64
|
import base64
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -271,7 +272,8 @@ def create_s3_bucket(s3_client, bucket_name):
|
|||||||
return bucket_name
|
return bucket_name
|
||||||
|
|
||||||
def upload_files_to_s3(s3_client, bucket_name, folder_path):
|
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 root, dirs, files in os.walk(folder_path):
|
||||||
for file in files:
|
for file in files:
|
||||||
file_path = os.path.join(root, file)
|
file_path = os.path.join(root, file)
|
||||||
|
Loading…
Reference in New Issue
Block a user