Skip to content

Commit 7746e07

Browse files
raphaelmwouterj
authored andcommitted
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 517e371 commit 7746e07

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
@@ -490,6 +490,9 @@ abstracts the hard work behind a simple API::
490490

491491
$response->headers->set('Content-Disposition', $d);
492492

493+
Then you must set the file's content as usual, for example by using
494+
:method:`Symfony\\Component\\HttpFoundation\\Response::setContent`.
495+
493496
Alternatively, if you are serving a static file, you can use a
494497
:class:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse`::
495498

0 commit comments

Comments
 (0)