Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
All solutions
    • All solutions for Object Storage
    • Resolving the Bucket not empty error when deleting a bucket from Object Storage
    • Resolving errors of access to a bucket with an assigned security policy
    • Resolving error 429
    • Resolving the "409 BucketAlreadyExists" error
    • Resolving the error of access to S3 buckets from a DataProc 1.4 cluster
    • Resolving error 403 (header is not provided when using the OPTION method)
    • Resolving certificate error
    • Resolving GATEWAY_REQUEST_ERROR
    • Resolving issues with incorrect MIME-types of objects when uploading them to Object Storage
    • Moving data from an Object Storage bucket to an ice storage
    • Restricting access to an Object Storage bucket using an IP range from Cloud CDN
    • Moving bucket contents to another bucket in the same the folder
    • Accessing Object Storage API directly, bypassing the SDK
    • Viewing and deleting incomplete uploads
    • How to determine the speed of data upload and download
    • How to configure cache-control headers for objects in a bucket during HTTP requests
    • How to restrict access to a bucket for a user
    • How to connect your own domain to a bucket
    • How to change the storage class

In this article:

  • Issue description
  • Solution
  • If the issue persists
  1. Object Storage
  2. Resolving issues with incorrect MIME-types of objects when uploading them to Object Storage

Resolving issues with incorrect MIME-types of objects when uploading them to Object Storage

Written by
Yandex Cloud
Updated at January 9, 2025
  • Issue description
  • Solution
  • If the issue persists

Issue descriptionIssue description

  • You encounter errors when accessing objects uploaded to Object Storage (images are not displayed, scripts do not work).
  • The JavaScript console of the browser shows errors about an invalid mime-type of objects uploaded from the bucket.

SolutionSolution

Object Storage reports that the objects uploaded to the buckets have the Content-Type specified during the upload.
If the Content-Type was omitted at upload, objects are assigned the default object Content-Type: binary/octet-stream.

Check the configuration of the S3 client you previously used to upload objects to the bucket specifies a relevant 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 persistsIf the issue persists

If the above actions did not help solve the problem, create a request for technical support.
When creating the request, provide the following information:

  1. Bucket ID in Object Storage.
  2. Link to the problematic object.
  3. Output from the JS console of the browser with the error or HAR file.

Was the article helpful?

Previous
Resolving GATEWAY_REQUEST_ERROR
Next
Moving data from an Object Storage bucket to an ice storage
© 2025 Direct Cursus Technology L.L.C.