All Products
Search
Document Center

Object Storage Service:Garbled characters in RAR files downloaded from OSS

Last Updated:Mar 19, 2026

Problem description

A RAR file downloaded from OSS displays garbled characters when opened. This happens because the object's Content-Type header does not match the actual file type. When Content-Type is set to a generic value instead of application/x-rar-compressed, the client misinterprets the file encoding and renders the content incorrectly.

Solutions

Update the Content-Type header on the object to application/x-rar-compressed:

  1. Log on to the OSS console.

  2. In the left navigation pane, click Buckets, then click the name of the bucket that contains the object.

  3. In the left navigation pane, click Files.

  4. Click the name of the RAR file to open its details panel.

  5. Click Edit next to HTTP headers (also called object metadata).

  6. Set Content-Type to application/x-rar-compressed.

  7. Click OK.

After saving, download the file again and verify it opens without garbled characters.

For a full list of configurable HTTP headers and detailed steps, see Configure object metadata.

Applicable scope

Object Storage Service (OSS)