Skip to content

Commit 16bf6db

Browse files
committed
minor #6613 Clarify documentation on serving files (raphaelm)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #6613). Discussion ---------- 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. Commits ------- 7746e07 Clarify documentation on serving files
2 parents 517e371 + 7746e07 commit 16bf6db

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)