1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
I was having the same problem with code adapted from https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-uploading-files.html
s3_client.upload_file completed without an exception but the file was not visible in the S3 web console or via "aws s3 ls s3://bucket-name"
The issue was with these lines:
if object_name is None:
object_name = file_name
file_name is actually a file path and the upload seems to silently fail if it contains path separators. The workaround is either to always provide an object_name or change it to:
if object_name is None:
object_name = file_name.split(os.path.sep)[-1:][0]
답변함 4년 전