# Namespace: `FILE` [@jupyterlite/contents](jupyterlite_contents.md).FILE A namespace for file constructs. ## Functions ### `getType` > > **`getType`**(`ext`, `defaultType?`): `string` Get a mimetype (or fallback). #### Parameters | Name | Type | Default value | | :------ | :------ | :------ | | `ext` | `string` | `undefined` | | `defaultType` | ``null`` \| `string` | `null` | #### Returns `string` #### Defined in [packages/contents/src/tokens.ts:156](https://github.com/jupyterlite/jupyterlite/blob/8254ff2/packages/contents/src/tokens.ts#L156) ### `hasFormat` > > **`hasFormat`**(`ext`, `fileFormat`): `boolean` Determine whether the given extension matches a given fileFormat. #### Parameters | Name | Type | | :------ | :------ | | `ext` | `string` | | `fileFormat` | ``"json"`` \| ``"text"`` \| ``"base64"`` | #### Returns `boolean` #### Defined in [packages/contents/src/tokens.ts:172](https://github.com/jupyterlite/jupyterlite/blob/8254ff2/packages/contents/src/tokens.ts#L172)