Concepts
MIME Type Detection

Automatic MIME Type Detection

For S3-compatible uploads, AIOZ Storage determines the final MIME type of each uploaded object. If you provide a Content-Type header, that value is used. Otherwise, AIOZ Storage detects the type from the file content.

How MIME Type is Determined

AIOZ Storage determines the final MIME type of an uploaded object using the following order of precedence:

  1. User-provided Content-Type header: If your upload request includes a Content-Type header, AIOZ Storage uses that value as the object's MIME type. This allows you to set the content type explicitly when needed.
  2. Automatic detection: If no Content-Type header is provided, AIOZ Storage analyzes the file content and detects the most likely MIME type automatically.

Note: If the file type cannot be determined confidently, AIOZ Storage falls back to application/octet-stream.

What this affects

This logic runs during object upload. The final MIME type is stored with the object metadata and used when the object is served later.

Powered by Google Magika

AIOZ Storage uses Google Magika (opens in a new tab) for content-based file type detection when a Content-Type header is not provided.

Instead of relying only on the file name or extension, Magika analyzes the file's byte content to help identify its type more accurately. This improves detection for files with missing, generic, or misleading extensions.

This approach helps AIOZ Storage assign a more appropriate MIME type automatically while still allowing users to specify Content-Type explicitly when needed.