> ## Documentation Index
> Fetch the complete documentation index at: https://bun.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the MIME type of a file

The `Bun.file()` function accepts a path and returns a `BunFile` instance. The `BunFile` class extends `Blob`, so use the `.type` property to read the MIME type.

```ts theme={"theme":{"light":"github-light","dark":"dracula"}}
const file = Bun.file("./package.json");
file.type; // application/json;charset=utf-8

const html = Bun.file("./index.html");
html.type; // text/html;charset=utf-8

const image = Bun.file("./image.png");
image.type; // image/png
```

***

See [File I/O](https://bun.com/docs/runtime/file-io.md) for more on working with `BunFile`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.