---
title: "DeliversFile – API-Referenz · Quittio"
description: "Download, inline display, mail attachment and storage for rendered files."
canonical_url: "https://quittio.dev/docs/api/Quittio/Laravel/Rendering/DeliversFile"
locale: de
meta:
  "og:description": "Download, inline display, mail attachment and storage for rendered files."
  "og:image": "https://quittio.dev/og/quittio-de.jpg"
  "og:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "DeliversFile – API-Referenz · Quittio"
  "twitter:image": "https://quittio.dev/og/quittio-de.jpg"
  "twitter:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
---

> Index of every page on this site: [llms.txt](https://quittio.dev/llms.txt)

[API reference](https://quittio.dev/docs/api) / [Quittio](https://quittio.dev/docs/api/Quittio) \\ [Laravel](https://quittio.dev/docs/api/Quittio/Laravel) \\ [Rendering](https://quittio.dev/docs/api/Quittio/Laravel/Rendering)

# DeliversFile

trait in quittio/laravel

`Quittio\Laravel\Rendering\DeliversFile` · [Source](https://github.com/Quittio/quittio/blob/v0.7.1/packages/laravel/src/Laravel/Rendering/DeliversFile.php#L19)

Download, inline display, mail attachment and storage for rendered files.

## Methods \#

| Method | Description |
| --- | --- |
| `->contents()` | |
| `->download()` | |
| `->filename()` | |
| `->mimeType()` | |
| `->save()` | Stores the main output on a filesystem disk (default: quittio.storage.disk). |
| `->stream()` | |
| `->toMailAttachment()` | |
| `->toResponse()` | |

### `contents()`#

```
abstract public function contents(): string
```

abstract

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `download()`#

```
public function download(?string $filename = null): Response
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$filename` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>Symfony\Component\HttpFoundation\Response</code></dd>
</dl>

### `filename()`#

```
abstract public function filename(?string $extension = null): string
```

abstract

| Parameter | Type | Description |
| --- | --- | --- |
| `$extension` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `mimeType()`#

```
abstract public function mimeType(): string
```

abstract

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `save()`#

```
public function save(?string $disk = null, ?string $path = null): string
```

Stores the main output on a filesystem disk (default: quittio.storage.disk).

| Parameter | Type | Description |
| --- | --- | --- |
| `$disk` | `?string` = `null` | |
| `$path` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>string</code> – the stored path</dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/RuntimeException">RuntimeException</a></code> – when the disk does not store the file</dd></dl>

### `stream()`#

```
public function stream(?string $filename = null): Response
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$filename` | `?string` = `null` | |

<dl><dt>Returns</dt>
<dd><code>Symfony\Component\HttpFoundation\Response</code></dd>
</dl>

### `toMailAttachment()`#

```
public function toMailAttachment(): Attachment
```

<dl><dt>Returns</dt>
<dd><code>Illuminate\Mail\Attachment</code></dd>
</dl>

### `toResponse()`#

```
public function toResponse(Request $request): Response
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$request` | `Illuminate\Http\Request` | |

<dl><dt>Returns</dt>
<dd><code>Symfony\Component\HttpFoundation\Response</code></dd>
</dl>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://quittio.dev/#website","@type":"WebSite","description":"E-Rechnungen für PHP und Laravel: ZUGFeRD, XRechnung und Peppol erstellen, prüfen, lesen und archivieren.","inLanguage":"de-DE","name":"Quittio","url":"https://quittio.dev/","publisher":{"@id":"https://quittio.dev/#identity"},"workTranslation":{"@id":"https://quittio.dev/en#website"}},{"@id":"https://quittio.dev/docs/api/Quittio/Laravel/Rendering/DeliversFile#webpage","@type":"WebPage","description":"Download, inline display, mail attachment and storage for rendered files.","name":"DeliversFile – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Laravel/Rendering/DeliversFile","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Laravel/Rendering/DeliversFile"]}],"primaryImageOfPage":{"@id":"https://quittio.dev/#logo"}},{"@id":"https://quittio.dev/#identity","@type":"Organization","description":"Open-Source-Bibliothek für E-Rechnungen in PHP und Laravel (ZUGFeRD, XRechnung, Peppol) und Quittio Managed.","email":"kontakt@niklasforst.de","legalName":"Niklas Forst – Softwareentwicklung","name":"Quittio","url":"https://quittio.dev","founder":{"@type":"Person","name":"Niklas Forst","url":"https://quittio.dev/ueber"},"logo":{"@id":"https://quittio.dev/#logo"},"sameAs":["https://github.com/Quittio/quittio","https://packagist.org/packages/quittio/quittio"]},{"@id":"https://quittio.dev/#logo","@type":"ImageObject","caption":"Quittio","contentUrl":"https://quittio.dev/logo.png","inLanguage":"de-DE","url":"https://quittio.dev/logo.png"}]}
```