0017-00000279

Updated at:

Problem description

OSS returns an error when the value of the x-oss-forbid-overwrite request header is invalid.

Causes

The x-oss-forbid-overwrite header was set to an invalid value. Valid values are true and false only.

Examples

The following PutObject request fails because x-oss-forbid-overwrite is set to abc:

PUT /test.txt HTTP/1.1
Host: test.oss-cn-zhangjiakou.aliyuncs.com
User-Agent: aliyun-sdk-python/2.6.0(Windows/7/AMD64;3.7.0)
Accept: */*
Connection: keep-alive
Content-Type: text/plain
date: Tue, 04 Dec 2018 15:56:37 GMT
authorization: OSS qn6q****************:kZoY****************
Transfer-Encoding: chunked
x-oss-forbid-overwrite:abc

Solutions

Set x-oss-forbid-overwrite to true or false.

The following example sets x-oss-forbid-overwrite to true, which prevents PutObject from overwriting an existing object with the same name:

PUT /test.txt HTTP/1.1
Host: test.oss-cn-zhangjiakou.aliyuncs.com
User-Agent: aliyun-sdk-python/2.6.0(Windows/7/AMD64;3.7.0)
Accept: */*
Connection: keep-alive
Content-Type: text/plain
date: Tue, 04 Dec 2018 15:56:37 GMT
authorization: OSS qn6q****************:kZoY****************
Transfer-Encoding: chunked
x-oss-forbid-overwrite:true

References