I want to upload a file to a version-enabled S3 bucket and need its version number. Ideally, without a separate API call to avoid any possibility of a race condition. I'm using the following code snippet for upload (which is working fine):
s3 = boto3.client("s3") s3.upload_fileobj(file_handle, bucket_name, key)
The response of this function is
None and I can't really see how it is defined in boto3, so it's hard to dive any deeper into it.
The official S3 documentation mentions that the version id is included in the header of the response after upload. However, I can't see how I can access this header with
Is this possible at all? If yes: how? If no: How can I hack boto3 so I can access this response header?
Fyi, I'm using
Thanks for your help!
Here the link to S3 documentation that talks about the