0017-00000251

Updated at:

Problem description

The styleName parameter value is rejected with an InvalidArgument error when creating or referencing an image style.

Causes

The image style name contains a character that is not allowed. Style names must be 1–63 characters long and can only contain letters, digits, underscores (_), hyphens (-), and periods (.).

Examples

The following request fails because the style name Images!tyle contains an exclamation mark (!), which is not an allowed character.

https://junchengtest.oss-cn-chengdu.aliyuncs.com/?style&styleName=Images!tyle
Authorization: OSS LTAI****************:PCX5************************
Date: Wed, 08 Feb 2023 06:56:00 GMT
body:
<Style>
  <Content>image/resize,p_60</Content>
</Style>

Error response:

<Error>
    <Code>InvalidArgument</Code>
    <Message>The value: Images!tyle of parameter: stylename is invalid.</Message>
    <RequestId>63E347B604ACC030350CF5D4</RequestId>
    <HostId>junchengtest.oss-cn-chengdu.aliyuncs.com</HostId>
</Error>

Solutions

Remove the invalid character (!) and rename the style using only allowed characters. For example, rename Images!tyle to image_style or ImageStyle. The style name must be 1–63 characters long and can only contain letters, digits, underscores (_), hyphens (-), and periods (.).

References