Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs for downloads to reflect the need to return it. Fixes #1331 #1340

Merged
merged 1 commit into from
Oct 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions user_guide_src/source/outgoing/response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,16 @@ Example::

$data = 'Here is some text!';
$name = 'mytext.txt';
$response->download($name, $data);
return $response->download($name, $data);

If you want to download an existing file from your server you'll need to
do the following::

// Contents of photo.jpg will be automatically read
$response->download('/path/to/photo.jpg', NULL);
return $response->download('/path/to/photo.jpg', NULL);

.. note:: The response object MUST be returned for the download to be sent to the client. This allows the response
to be passed through all **after** filters before being sent to the client.

HTTP Caching
============
Expand Down