Set object metadata in completeMultipartUpload
Describe the feature
Allows us to set the object metadata in completeMultipartUpload, not just in initiateMultipartUpload.
Is your Feature Request related to a problem?
I have some user-defined metadata that is calculated after I finish multipart upload.
Therefore, I need to set them in completeMultipartUpload.
I know I can do this through Copying an object using multipart upload, but it will be grateful if I could simply set user-defined metadata in completeMultipartUpload.
Proposed Solution
No response
Describe alternatives you've considered
An API for updating object metadata (instead of using copy to update object metadata)
Acknowledge
- [ ] I may be able to implement this feature request
AWS Java SDK version used
2.17.46
JDK version used
1.8.0_301
Operating System and version
Windows 10
Hi @joy45689. Thank you for your feedback.
This is a feature/requirement of the S3 API as documented here:
If you want to provide any metadata describing the object being uploaded, you must provide it in the request to initiate multipart upload.
And here:
After you upload the object, you cannot modify object metadata. The only way to modify object metadata is to make a copy of the object and set the metadata.
Unfortunately, there is nothing that the Java SDK can do to bypass this API design. Possible workarounds to consider:
- As you already mentioned, copying the object in-place while updating the object metadata. (This may be slow for very large objects.)
- If possible, delay or buffer your
createMultipartUploadcall until you can determine the metadata that you wish to use.
I will also forward your feedback to the S3 service team.