1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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]
répondu il y a 4 ans
Contenus pertinents
- demandé il y a 5 mois
- demandé il y a un an
- demandé il y a un an
- demandé il y a un mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a un an