Skip to content

Commit

Permalink
minor #6613 Clarify documentation on serving files (raphaelm)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
wouterj committed Jul 8, 2016
2 parents 517e371 + 7746e07 commit 16bf6db
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 16bf6db

Please sign in to comment.