0040-00000031

Updated at:

Problem description

Source image protection is enabled for the image you are trying to access.

Causes

When source image protection is enabled, anonymous requesters cannot apply image processing parameters (such as x-oss-process=image/...) directly in the URL. Only URLs that reference a named style (using x-oss-process=style/...) are accepted for anonymous requesters.

This restriction prevents external users from manipulating image processing logic through URL parameters. Processing rules must be defined as named styles in advance.

Examples

The following request fails because it applies the processing parameter image/format,webp directly in the URL instead of referencing a style:

GET /example_image.jpg?x-oss-process=image/format,webp HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 03 Feb 2023 03:41:49 GMT
Content-Type: application/xml
Content-Length: 123

Source image protection is enabled for example_image.jpg. OSS returns an error because the URL does not reference a style.

Solutions

Create a style named webp using the image/format,webp parameter, then update the request to reference that style:

GET /example_image?x-oss-process=style/webp HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 03 Feb 2023 03:41:49 GMT
Content-Type: application/xml

The request now uses x-oss-process=style/webp instead of x-oss-process=image/format,webp. Anonymous requesters can access the image once the URL references a valid style.

Any existing URLs that apply processing parameters directly (such as ?x-oss-process=image/format,webp) will continue to fail for anonymous requesters after source image protection is enabled. Update those URLs to use the style/ format.

References

Protect source images