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:
Log on to the OSS console.
In the left navigation pane, click Buckets, then click the name of the bucket that contains the object.
In the left navigation pane, click Files.
Click the name of the RAR file to open its details panel.
Click Edit next to HTTP headers (also called object metadata).
Set
Content-Typetoapplication/x-rar-compressed.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)