Fixing issues with incorrect MIME types of objects when uploading them to Object Storage
Written by
Updated at December 17, 2025
Issue description
- You encounter errors when accessing objects uploaded to Object Storage, e.g., images are not displayed or scripts do not work.
- The JavaScript console of your browser shows invalid MIME type errors for objects uploaded from the bucket.
Solution
For objects uploaded to the buckets, Object Storage provides the Content-Type specified during the upload.
If you did not specify the Content-Type, objects get the default Content-Type, binary/octet-stream.
Make sure the configuration of the S3 client you used to upload objects to the bucket contains the correct Content-Type. You need to explicitly specify it when uploading a file to the bucket. You can also specify it for previously uploaded objects via the S3 client or SDK of your choice:
AWS CLI
s3cmd
aws s3 cp --endpoint-url=https://storage.yandexcloud.net \
s3://<bucket-name>/ \
s3://<bucket-name>/ \
--exclude '*' \
--include '*.js' \
--no-guess-mime-type \
--content-type="application/javascript" \
--metadata-directive="REPLACE" \
--recursive
s3cmd put --recursive \
--exclude "*" \
--include "*.js" \
--no-mime-magic \
--mime-type="application/javascript" \
--no-preserve \
--acl-public \
/path/to/local/directory \
s3://<bucket-name>/
If the issue persists
If the above actions did not help, create a support ticket
- Bucket ID in Object Storage.
- Link to the object in question.
- Output from the JavaScript console of your browser with the error, or HAR file.