Extension Lookup
Bounded off line10common MIME type→preferred extension inventory; optional parameters ignored, not all valid alternate extensions or MIME security/content verification.
Description
A media type may have several associated file extensions.
A media type may have several associated file extensions.1
A preferred extension helps label a file, while the actual bytes and required format still need to match that label. The calculation and input requirements are explained below.
When to use Extension Lookup
Enter a media type.
How to use Extension Lookup and how it works
- Prepare the measurements or independently established model inputs described below, with matching units and observation scope.
- Enter the required fields and run Extension Lookup.
- Read the result fields using the formula, output units, signs and ordering explained below.
- Correct any rejected inputs and rerun; interpret the result within the stated model and its assumptions.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| actualMimeType | Actual Mime Type. Use the units and matching context stated in the calculation below. | string | Required; other constraints below |
Enter a media type. Keep the portion before the first semicolon, trim it and lowercase it; validate the implementation's simple type/subtype token grammar. Return the preferred extension from the ten-entry table, or empty text and found=false for an unknown valid token. Parameters are ignored rather than parsed or validated, and alternative extensions are not enumerated.
preferredExtension=inventory[normalizedTypeSubtype] or ''; found=inventoryContainsKey Apply the input ordering, units and branch conditions stated above.
| Extension | Media type |
|---|---|
| txt | text/plain |
| html | text/html |
| css | text/css |
| js | text/javascript |
| json | application/json |
| application/pdf | |
| png | image/png |
| jpg | image/jpeg |
| svg | image/svg+xml |
| wasm | application/wasm |
| Output field | Meaning | Value type |
|---|---|---|
| result | Object containing the calculated or selected fields below. | object |
| result.preferredExtension | Preferred Extension. Interpret its unit, sign, order or availability flag as explained above. | string |
| result.foundInBoundedInventory | Found In Bounded Inventory. Interpret its unit, sign, order or availability flag as explained above. | boolean |
{
"input": {
"actualMimeType": "application/json"
},
"output": {
"result": {
"preferredExtension": "json",
"foundInBoundedInventory": true
}
}
} Limitations and assumptions
The calculation uses the supplied observations and model inputs. It does not collect measurements, select a reference population or coefficient, or establish that the model applies to the actual case. The stated branch conditions and output units remain part of the result.
All fields require explicit values. Unexpected fields, wrong types, nonfinite numbers and sparse arrays are rejected. Alignment, bounds and supported-token rules are explained above; extremely large inputs or nonfinite results can also fail. Input errors differ from successful false comparisons, unavailable-domain flags and empty match lists.
Alternative or Complementary methods
Use Mime Type Lookup for a complementary operation: A media type describes a file or representation using a type/subtype name.
Use Content Encoding Detector for a complementary operation: Content-Encoding declares transformations applied to an HTTP representation, such as compression.
References
-
Extension Lookup — tool.io
Similar or alternative tools
- Mime Type Lookup
A media type describes a file or representation using a type/subtype name.
- Content Encoding Detector
Content-Encoding declares transformations applied to an HTTP representation, such as compression.