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

# File

The `File` class allows you to display a button that lets users download the content of the file.

You must provide either an url or a path or content bytes.

## Attributes

<ParamField path="name" type="str">
  The name of the file. This will be shown to users.
</ParamField>

<ParamField path="url" type="str" optional>
  The remote URL of the file image source.
</ParamField>

<ParamField path="path" type="str" optional>
  The local file path of the file image.
</ParamField>

<ParamField path="content" type="bytes" optional>
  The file content of the file image in bytes format.
</ParamField>

## Example

```python theme={null}
import chainlit as cl


@cl.on_chat_start
async def start():
    elements = [
        cl.File(
            name="hello.py",
            path="./hello.py",
            display="inline",
        ),
    ]

    await cl.Message(
        content="This message has a file element", elements=elements
    ).send()
```
