---
title: "file"
description: "Serve a file from a path as the response."
url: "https://next.elysiajs.com/reference/variables/file/"
---

# file

```ts
const file: (path) => ElysiaFile;
```

Defined in: elysia/dist/universal/file.d.ts:43

Serve a file from a path as the response.

## Parameters

| Parameter | Type     |
| --------- | -------- |
| `path`    | `string` |

## Returns

[`ElysiaFile`](/reference/classes/elysiafile/)
