Skip to content

Commit

Permalink
Clarify documentation on serving files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
raphaelm authored and wouterj committed Jul 8, 2016
1 parent 517e371 commit 7746e07
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,9 @@ abstracts the hard work behind a simple API::

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

Then you must set the file's content as usual, for example by using
:method:`Symfony\\Component\\HttpFoundation\\Response::setContent`.

Alternatively, if you are serving a static file, you can use a
:class:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse`::

Expand Down

0 comments on commit 7746e07

Please sign in to comment.