【发布时间】:2022-01-24 20:58:19
【问题描述】:
当我尝试使用 python 和 boto3 将文件上传到我的 ASW s3 时,它工作正常,我能够成功地将它上传到 aws s3,但是当我尝试上传一个文件夹时,我得到了
getting PermissionError: [Errno 13]
我的代码是
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)
print("Upload Successful")
return True
except FileNotFoundError:
print("The file was not found")
return False
except NoCredentialsError:
print("Credentials not available")
return False
【问题讨论】:
-
进展如何?仍然不清楚你能做什么?
标签: python amazon-web-services amazon-s3 boto3