Forbid overwrite header

When making a request to write data, it is possible to set a condition on that request to avoid a unnecessary operation. If a request is made in which a user does NOT want to overwrite an existing object (with the same name as for the request), the following header can be specified.

Table 1. x-ibm-forbid-overwrite
Header Type Description
x-ibm-forbid-overwrite Boolean (true/false) case insensitive

On an object PUT, POST, PUT (copy), Initiate Multipart Upload, or Complete Multipart Upload request thex-ibm-forbid-overwrite header with a value of 'true' (case insensitive) will check to see if an object of the same name already exists. If the object already exists, then the write request will return a 409 - ObjectAlreadyExists error.

If the header value is false or empty, the check will NOT occur and the header will be ignored.

Note: If the header is used on a write request to a bucket that is Versioned (enabled or suspended), the header will be ignored regardless of value)
Note: Feature must be enabled by system owner to utilize this feature.
Note: About the Initiate and Complete MPU requests, if a forbid overwrite header is used for the Initiate MPU request the system checks if this MPU operation causes an overwrite. Use of the header in the Initiate MPU request prevents you from starting a potentially long running upload request that runs into this conflict. Independent of the outcomes of the Initiate MPU, you can later add a forbid overwrite header to the Complete MPU request to check, again, if the write causes an overwrite. Ultimately, if you want to prevent an overwrite as part of an MPU request, you should include the header on the Complete MPU request.