Skip to content

Commit 91b3106

Browse files
committed
Clarify documentation on serving files
For a beginner, the "Serving Files" documentation was a little bit ambiguous on whether the makeDisposition method only adds the header or deals with sending the content as well. This change tries to make that explicit.
1 parent 00aad1e commit 91b3106

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/http_foundation/introduction.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,9 @@ abstracts the hard work behind a simple API::
483483

484484
$response->headers->set('Content-Disposition', $d);
485485

486+
Then you must set the file's content as usual, for example by using
487+
:method:`Symfony\\Component\\HttpFoundation\\Response::setContent`.
488+
486489
Alternatively, if you are serving a static file, you can use a
487490
:class:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse`::
488491

0 commit comments

Comments
 (0)