The MIME type of your object determines how a browser interacts with your object when it is requested for download. For example, if you have an image hosted on Wasabi that you want to display in a browser when the link is clicked, the browser will know how to display the image only if the MIME type value accurately indicates that it is an image. For example, if your object has a MIME type of image/png, the browser will know the object is an image and will display it as such. However, if the object's MIME type is set as application/octet-stream, the browser will assume this is an application and will prompt the user to download the object (rather than displaying the object).
Review a list of common MIME types (https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types).
The MIME type will be set on the object during the PUT operation to the bucket. If using the Wasabi Console, the browser should understand that an image should have the appropriate values to be displayed properly when requested. However, depending on your PUT method, this value may not always be set correctly.
This value can be changed with an API call to your Wasabi bucket and the key/value that you want to change. The API call needed is the PutObject call with the URI Request Parameter of Content-Type and the value you want to associate with it. An easy way to achieve this is with the AWS CLI.
This example uploads a picture to a bucket called virginia and sets the MIME/content-type to binary/octet-stream:
$ aws s3api head-object --bucket virginia --key picture.jpg --endpoint-url=https://s3.wasabisys.com
{
"AcceptRanges": "bytes",
"LastModified": "2021-02-15T18:06:03+00:00",
"ContentLength": 0,
"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
"ContentType": "binary/octet-stream",
"Metadata": {}
}You can change this to your desired value via the put-object call with the --content-type flag:
$ aws s3api put-object --bucket virginia --key picture.jpg --body picture.jpg --content-type=image/jpeg --endpoint-url=https://s3.wasabisys.com
{
"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\""
}The new MIME/Content-Type value is:
$ aws s3api head-object --bucket virginia --key picture.jpg --endpoint-url=https://s3.wasabisys.com
{
"AcceptRanges": "bytes",
"LastModified": "2021-02-15T18:06:51+00:00",
"ContentLength": 0,
"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
"ContentType": "image/jpeg",
"Metadata": {}
}Modify the above put-object command to work with your environment (bucket/key/content-type/endpoint), and the content should display properly.