如何使用python在AWS中上传图片文件夹。对于单个图像,它可以工作,但是如何上传图像文件夹,在这里product_id_1.jpg,它可以正常工作
def upload_to_aws(local_file, bucket, s3_file):
s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET_KEY)
try:
#s3.upload_file(local_file, bucket, s3_file)
s3.upload_file(local_file,bucket, "uploads/products/product_id_1.jpg")