# (file: …)

Creates a download link for any file

****

- Source: <https://github.com/getkirby/kirby/tree/5.5.3/config/tags.php#L56>

****

## Attributes

In addition to the main `file` option, the tag supports the following attributes: `class`, `download`, `rel`, `target`, `text`, `title`

| Attribute | Description | Default |
|---- | ---- | ---- |
| class | The class which is added to file link | `null` |
| download | The download attribute that is added to file link | `true` |
| rel | The rel attribute that is added to file link | `null` |
| target | The target attribute that is added to file link | `null` |
| text | The text that is added to file link | `null` |
| title | The title attribute that is added to file link | `null` |

### Attribute defaults from config

You can customize the defaults of this tag's attributes via the <a href="https://getkirby.com/docs/reference/system/options/kirbytext#file">`kirbytext.file` config option</a>.

## Examples

### Download link with filename as text

```kirbytext
(file: companysecrets.pdf)
```

### Download link with custom text

```kirbytext
(file: companysecrets.pdf text: Download our company secrets)
```

### Download link for a file from another internal page

```kirbytext
(file: some/other/page/companysecrets.pdf text: Download our company secrets)
```

### Download link for an external file

```kirbytext
(file: http://example.com/companysecrets.pdf text: Download their company secrets)
```

### Download link with a `title` attribute

```kirbytext
(file: companysecrets.pdf title: Download our company secrets)
```

### Download link with a `rel` attribute

```kirbytext
(file: cv.pdf text: My CV rel: me)
```

### Download link with a specified target

```kirbytext
(file: companysecrets.pdf target: _blank)
```

### Download link with a custom CSS class

```kirbytext
(file: companysecrets.pdf class: download)
```

### Download link with `download` attribute

To avoid direct downloads you can set the `download` option to `false`:

```kirbytext
(file: companysecrets.pdf download: false)
```